Repository navigation
Closed
Labels
closed: questionThis issue is a user error/misunderstanding.
Description
🐛 Bug Report
Cannot build docs on 2.0.0-alpha.75, 2.0.0-alpha.74 works well.
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
- The issue is here chore(deps): update docusaurus monorepo to v2.0.0-alpha.75 (patch) help-me-mom/ng-mocks#466
- Clone the repo
- Switch to branch
renovate/root/patch-docusaurus-monorepo - execute
npm install - execute
npm run build:docs
Expected behavior
The build should succeed.
Actual Behavior
Fails with the next error
[en] Creating an optimized production build...
[info] [webpackbar] Compiling Client
error building locale=en
TypeError: Cannot read property 'intercept' of undefined
at /Users/michael/projects/ng-mocks/node_modules/webpack/lib/ProgressPlugin.js:242:30
at Array.forEach (<anonymous>)
at /Users/michael/projects/ng-mocks/node_modules/webpack/lib/ProgressPlugin.js:239:24
at Hook.eval [as call] (eval at create (/Users/michael/projects/ng-mocks/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:100:1)
at Hook.CALL_DELEGATE [as _call] (/Users/michael/projects/ng-mocks/node_modules/tapable/lib/Hook.js:14:14)
at Compiler.newCompilation (/Users/michael/projects/ng-mocks/node_modules/@docusaurus/core/node_modules/webpack/lib/Compiler.js:1031:26)
at /Users/michael/projects/ng-mocks/node_modules/@docusaurus/core/node_modules/webpack/lib/Compiler.js:1073:29
at Hook.eval [as callAsync] (eval at create (/Users/michael/projects/ng-mocks/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/michael/projects/ng-mocks/node_modules/tapable/lib/Hook.js:18:14)
at Compiler.compile (/Users/michael/projects/ng-mocks/node_modules/@docusaurus/core/node_modules/webpack/lib/Compiler.js:1068:28)
at /Users/michael/projects/ng-mocks/node_modules/@docusaurus/core/node_modules/webpack/lib/Compiler.js:496:12
at Compiler.readRecords (/Users/michael/projects/ng-mocks/node_modules/@docusaurus/core/node_modules/webpack/lib/Compiler.js:908:11)
at /Users/michael/projects/ng-mocks/node_modules/@docusaurus/core/node_modules/webpack/lib/Compiler.js:493:11
at Hook.eval [as callAsync] (eval at create (/Users/michael/projects/ng-mocks/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/michael/projects/ng-mocks/node_modules/tapable/lib/Hook.js:18:14)
at /Users/michael/projects/ng-mocks/node_modules/@docusaurus/core/node_modules/webpack/lib/Compiler.js:490:20
Your Environment
- Public source code: chore(deps): update docusaurus monorepo to v2.0.0-alpha.75 (patch) help-me-mom/ng-mocks#466
- Public site url:
- Docusaurus version used:
2.0.0-alpha.75 - Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): not relevant, fails on linux and macos
- Operating system and version (desktop or mobile): desktop
Reproducible Demo
Metadata
Metadata
Assignees
Labels
closed: questionThis issue is a user error/misunderstanding.
Activity
slorber commentedon May 1, 2021
satanTime commentedon May 1, 2021
There is no cache on my CI and docs are built from scratch on every commit, but I'll try it in some hours.
slorber commentedon May 1, 2021
satanTime commentedon May 1, 2021
The idea is to follow monorepo approach. There is one global
package.jsonwhich has all the dependencies for all projects in the repo and they are installed on the root level.docsare a project in the repo and the idea is that itspackage.jsononly describes desired dependencies and their versions (the same as in the global package.json), but all scripts use parentnode_modules.I'll try to play with
scripts, maybe../node_modules/.binis the issue.wibed commentedon May 1, 2021
I am experiencing the same issue with
2.0.0-alpha.75 with i18n - https://pastebin.com/inhL60ap
2.0.0-alpha.74 with i18n - https://pastebin.com/GqYi0M8t
2.0.0-alpha.72 works but the i18n url breaks if there is a baseURL configured
as pointed out here: #3309
slorber commentedon May 1, 2021
@wibed I don't understand how your problem is related to the current issue. This issue is a alpha 74 -> 75 upgrade problem.
Please open another issue with a repro repository that I can inspect.
error building locale=enis a very generic message that will be printed whenever a site does not build. Will try to improve it to make this clearerwibed commentedon May 2, 2021
@slorber indeed it does not.
Ive mistakenly took the error, based on the message, for a similar problem.
Ive been able to fix my issue, by rebuilding on the new .75 version bit by bit.
slorber commentedon May 3, 2021
This is not a problem in Docusaurus, but it is a problem in your repo @satanTime
After upgrading to alpha.75 (now on Webpack 5), you still end up with
node_modules/webpackbeing Webpack 4, while Docusaurus needs Webpack 5.It is your responsibility to not mess-up with the dependencies and ensure that Docusarus is able to use the Webpack version it needs, and I think your setup mess-up with the dependencies.
If you are not using npm/yarn workspaces and the hoisting features permitting multiple webpack versions to cohabit, you should then rather install docusaurus deps independently in the docs subfolder.
Eventually, you could try to add "webpack@5" at the root of your monorepo, it might permit Docusaurus to build, but it might break other things of your repo... this is not a solution I'd recommend.
This PR shows that your site can definitively build using latest Docusaurus: help-me-mom/ng-mocks#475
satanTime commentedon May 3, 2021
Hi @slorber, thanks for the info... that is the thing I was afraid of. I tried webpack@5 in the global package.json but it didn't work out unfortunately.
I'll try to play with it more. Thanks for your help.
PS. Frankly speaking, I don't understand benefit of having a single package.json with all the deps... maybe one day... thanks again.
slorber commentedon May 3, 2021
I don't know either 😅 you can't expect this strategy to remain sustainable over time particularly when your monorepo packages have different lifecycles and dependencies
satanTime commentedon May 3, 2021
yes, exactly :) I remember reading
nxcreator's answer "You need time to understand why the global package.json works better", so I don't give up :) Although there were several bell rings and one more is here again.Caperious commentedon May 12, 2021
@satanTime How did u resolve the issue? Moved the docusaurus to its own repo?
satanTime commentedon May 12, 2021
Hi @satanTime, not moving, but allowing it having own node_modules, before it had to be
peerDependencies, now it isdependencies: help-me-mom/ng-mocks@91f4ee7Unfortunately, I wasn't able to make friends angular with webpack4 and docusaurus with webpack5 with a single package.json