Skip to content

Docusaurus Faster failed to build under yarn PnP mode #10787

@smeng9

Description

@smeng9

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and 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

https://stackblitz.com/edit/github-vzunfajq?file=package.json,docusaurus.config.ts

Steps to reproduce

  1. Perform $ npm init docusaurus@latest with classic and TypeScript
  2. Set the package manager to latest yarn to install dependencies PnP mode $ yarn set version canary && yarn
  3. Update the docusaurus.config.ts to enable future.experimental_faster to true
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executionexternalThis issue is caused by an external dependency and not Docusaurus.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions