Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to 'faster' causes error on build #10667

Closed
5 of 7 tasks
liam-swinney opened this issue Nov 11, 2024 · 1 comment
Closed
5 of 7 tasks

Upgrading to 'faster' causes error on build #10667

liam-swinney opened this issue Nov 11, 2024 · 1 comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: invalid This issue / PR is low quality, unwanted or spam and doesn't qualify as a contribution in any way.

Comments

@liam-swinney
Copy link

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

npm run build :

[WARNING] Docusaurus site warnings:
- Your site is using the SWC js loader. You can safely remove the Babel config file at `babel.config.js`.
●  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ (8%) setup compilation
●  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ (9%) setup compilation                                                                                                                                          [ERROR] Error:   × TypeError: Cannot read properties of undefined (reading 'set')
  │     at Object.fn (/Users/{redacted}/node_modules/webpack/lib/DefinePlugin.js:362:37)
  │     at SyncHook.callAsyncStageRange (/Users/{redacted}/node_modules/@rspack/lite-tapable/dist/index.js:240:21)
  │     at SyncHook.callStageRange (/Users/{redacted}/node_modules/@rspack/lite-tapable/dist/index.js:259:14)
  │     at QueriedHook.call (/Users/{redacted}/node_modules/@rspack/lite-tapable/dist/index.js:218:26)
  │     at /Users/{redacted}/node_modules/@rspack/core/dist/index.js:17454:36
  │     at last.function (/Users/{redacted}/node_modules/@rspack/core/dist/index.js:17936:25)
  │


[ERROR] Error: Unable to build website for locale en.
    at tryToBuildLocale (/Users/{redacted}/node_modules/@docusaurus/core/lib/commands/build/build.js:78:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/{redacted}/node_modules/@docusaurus/core/lib/commands/build/build.js:34:9
    at async mapAsyncSequential (/Users/{redacted}/node_modules/@docusaurus/utils/lib/jsUtils.js:21:24)
    at async Command.build (/Users/{redacted}/node_modules/@docusaurus/core/lib/commands/build/build.js:33:5) {
  [cause]: [Error:   × TypeError: Cannot read properties of undefined (reading 'set')
    │     at Object.fn (/Users/{redacted}/node_modules/webpack/lib/DefinePlugin.js:362:37)
    │     at SyncHook.callAsyncStageRange (/Users/{redacted}/node_modules/@rspack/lite-tapable/dist/index.js:240:21)
    │     at SyncHook.callStageRange (/Users/{redacted}/node_modules/@rspack/lite-tapable/dist/index.js:259:14)
    │     at QueriedHook.call (/Users/{redacted}/node_modules/@rspack/lite-tapable/dist/index.js:218:26)
    │     at /Users/{redacted}/node_modules/@rspack/core/dist/index.js:17454:36
    │     at last.function (/Users/{redacted}/node_modules/@rspack/core/dist/index.js:17936:25)
    │
  ] {
    code: 'GenericFailure'
  }
}

npm run start

●  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ (9%) setup compilation                                                                     <e> [webpack-dev-middleware] [Error:   × TypeError: Cannot read properties of undefined (reading 'set')
<e>   │     at Object.fn (/Users/{redacted}/node_modules/webpack/lib/DefinePlugin.js:362:37)
<e>   │     at SyncHook.callAsyncStageRange (/Users/{redacted}/node_modules/@rspack/lite-tapable/dist/index.js:240:21)
<e>   │     at SyncHook.callStageRange (/Users/{redacted}/node_modules/@rspack/lite-tapable/dist/index.js:259:14)
<e>   │     at QueriedHook.call (/Users/{redacted}/node_modules/@rspack/lite-tapable/dist/index.js:218:26)
<e>   │     at /Users/{redacted}/node_modules/@rspack/core/dist/index.js:17454:36
<e>   │     at last.function (/Users/{redacted}/node_modules/@rspack/core/dist/index.js:17936:25)
<e>   │ 
<e> ] {
<e>   code: 'GenericFailure'
<e> }

I've updated my existing build to 3.6.1 (I have confirmed this version works fine). I have then installed 'faster' and have enabled this in my docusaurus.config.js file.

I have tried the combination of npm run clear, the recommended removal of the modules/lock files and reinstaillation and still get the issue.

I've also tried to 'downgrade' my rspack version as per the recommendations in #10664 (comment), I can see in my package.lock file this is using 1.0.14, however I get the issue either way!

Thanks

Reproducible demo

No response

Steps to reproduce

Unable to replicate on a fresh build

Expected behavior

The builds to build correctly with no errors

Actual behavior

See the description for error codes

Your environment

  • Public source code: N/A
  • Public site URL: N/A
  • Docusaurus version used: 3.6.1
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Node 22, NPM 10.8.2
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Mac Version 15.0.1

Self-service

  • I'd be willing to fix this bug myself.
@liam-swinney liam-swinney added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Nov 11, 2024
@slorber
Copy link
Collaborator

slorber commented Nov 11, 2024

It is impossible to help you without a repro.

The error message is familiar to me and is very likely related to a custom or third-party Docusaurus plugin that doesn't support Rspack and is using webpack.DefinePlugin instead of currentBundler.instance.DefinePlugin

Please read this to understand what must be done: #10572

@slorber slorber closed this as not planned Won't fix, can't repro, duplicate, stale Nov 11, 2024
@slorber slorber added closed: invalid This issue / PR is low quality, unwanted or spam and doesn't qualify as a contribution in any way. and removed status: needs triage This issue has not been triaged by maintainers labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: invalid This issue / PR is low quality, unwanted or spam and doesn't qualify as a contribution in any way.
Projects
None yet
Development

No branches or pull requests

2 participants