Repository navigation
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
I expect the docusaurus faster to be working out of the box with yarn in a clean template project however it is not.
Reproducible demo
Steps to reproduce
- Perform
$ npm init docusaurus@latestwithclassicandTypeScript - Set the package manager to latest yarn to install dependencies PnP mode
$ yarn set version canary && yarn - Update the
docusaurus.config.tsto enablefuture.experimental_fastertotrue - Build the website
$ yarn build
Expected behavior
The website should be able to build
Actual behavior
It throws errors for build
● Client ██████████████████████████████████████████████████ (93%) sealing after asset optimization
● Server ██████████████████████████████████████████████████ (93%) sealing after asset optimization [ERROR] Client bundle compiled with errors therefore further build is impossible.
× Module not found: Can't resolve '/Users/[redacted]/Developer/website/.yarn/virtual/@docusaurus-core-virtual-7a135ef58f/3/.yarn/berry/cache/@docusaurus-core-npm-3.6.3-a0940a712c-10c0.zip/node_modules/@docusaurus/core/lib/client/clientEntry.js' in '/Users/[redacted]/Developer/website'
and errors for start
[INFO] Starting the development server...
[SUCCESS] Docusaurus website is running at: http://localhost:3000/
● Client ██████████████████████████████████████████████████ (100%) emitting after emit × Module not found: Can't resolve '/Users/[redacted]/Developer/website/.yarn/virtual/@docusaurus-core-virtual-7a135ef58f/3/.yarn/berry/cache/@docusaurus-core-npm-3.6.3-a0940a712c-10c0.zip/node_modules/@docusaurus/core/lib/client/clientEntry.js' in '/Users/[redacted]/Developer/website'
× Module not found: Can't resolve '/Users/[redacted]/Developer/website/.yarn/virtual/webpack-virtual-20fb5ab00f/3/.yarn/berry/cache/webpack-npm-5.97.1-b41b9903c1-10c0.zip/node_modules/webpack/hot/dev-server.js' in '/Users/[redacted]/Developer/website'
× Module not found: Can't resolve '/Users/[redacted]/Developer/website/.yarn/virtual/webpack-dev-server-virtual-13f949419a/3/.yarn/berry/cache/webpack-dev-server-npm-4.15.2-56919849cc-10c0.zip/node_modules/webpack-dev-server/client/index.js?protocol=ws%3A&hostname=0.0.0.0&port=0&pathname=%2Fws&logging=warn&progress=true&overlay=%7B%22errors%22%3Atrue%2C%22warnings%22%3Afalse%7D&reconnect=10&hot=true&live-reload=false' in '/Users/[redacted]/Developer/website'
× Error: Child compilation failed:
│ × Module not found: Can't resolve '/Users/[redacted]/Developer/website/.yarn/virtual/@docusaurus-core-virtual-7a135ef58f/3/.yarn/berry/cache/@docusaurus-core-npm-3.6.3-a0940a712 c-10c0.zip/node_modules/@docusaurus/core/lib/webpack/templates/dev.html.template.ejs' in '/Users/[redacted]/Developer/website'
│
│ - child-compiler.js:211
│ [html-webpack-plugin-npm-5.6.3-57a7b18662-10c0.zip]/[html-webpack-plugin]/lib/child-compiler.js:211:18
│
│ - index.js:13681 finalCallback
│ [@rspack-core-npm-1.1.8-0093048ff4-10c0.zip]/[@rspack]/core/dist/index.js:13681:9
│
│ - index.js:13703
│ [@rspack-core-npm-1.1.8-0093048ff4-10c0.zip]/[@rspack]/core/dist/index.js:13703:14
│
│ - index.js:13805
│ [@rspack-core-npm-1.1.8-0093048ff4-10c0.zip]/[@rspack]/core/dist/index.js:13805:18
│
│ - index.js:473 done
│ [@rspack-lite-tapable-npm-1.0.1-a0c24b9689-10c0.zip]/[@rspack]/lite-tapable/dist/index.js:473:13
│
│ - index.js:480 AsyncSeriesHook.callAsyncStageRange
│ [@rspack-lite-tapable-npm-1.0.1-a0c24b9689-10c0.zip]/[@rspack]/lite-tapable/dist/index.js:480:20
│
│ - index.js:82 AsyncSeriesHook.callAsync
│ [@rspack-lite-tapable-npm-1.0.1-a0c24b9689-10c0.zip]/[@rspack]/lite-tapable/dist/index.js:82:21
│
│ - index.js:13801
│ [@rspack-core-npm-1.1.8-0093048ff4-10c0.zip]/[@rspack]/core/dist/index.js:13801:33
│
│ - index.js:13845
│ [@rspack-core-npm-1.1.8-0093048ff4-10c0.zip]/[@rspack]/core/dist/index.js:13845:37
│
│
client (Rspack 1.1.8) compiled with 8 errors
Your environment
- Public source code:
- Public site URL:
- Docusaurus version used: 3.6.3
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Safari 17.5, Node.js 20.10
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): macOS Sonoma 14.5
Self-service
- I'd be willing to fix this bug myself.
Activity
slorber commentedon Dec 23, 2024
This is a bug in Rspack, not Docusaurus
Tracked here: web-infra-dev/rspack#2236
slorber commentedon Jan 17, 2025
Looks like Yarn PnP will be solved in Rspack v1.2 soon
web-infra-dev/rspack#7639
smeng9 commentedon Jan 21, 2025
Rspack 1.2 is release now
slorber commentedon Jan 31, 2025
Tried using PnP on another website and still got errors with v1.2:
easyops-cn/docusaurus-search-local#468 (comment)
slorber commentedon Mar 13, 2026
Going to reopen this because we still do not support Rspack + Yarn PnP
Considering Docusaurus Faster is becoming the new default (#11802), this is annoying because our CI E2E tests fail under PnP
To unlock this situation, I added the following fallback to Webpack, ensuring Yarn PnP users can still start/build their site, and also fixing our CI workflow temporarily.
For future self, here's how to run E2E tests locally for Yarn PnP:
And here are the errors we get when trying to run Rspack + PnP:
These are often related to legacy packages like
react-isorprop-types. I have good hopes that in Docusaurus v4 this issue will eventually self-resolve 🤷♂️