Not compatible with alpha 75 / Webpack 5
See original GitHub issueHi, Docusaurus maintainer here
I’m testing the latest alpha 75 release (Webpack 5) on a few sites, and this one is failing to upgrade due to this plugin: https://github.com/nextauthjs/next-auth/pull/1826
Error: Conflict: Multiple chunks emit assets to the same filename server.bundle.js (chunks 179 and 462)
at /Users/sebastienlorber/Desktop/projects/next-auth/www/node_modules/webpack/lib/Compilation.js:3864:12
at /Users/sebastienlorber/Desktop/projects/next-auth/www/node_modules/webpack/lib/Cache.js:85:6
at /Users/sebastienlorber/Desktop/projects/next-auth/www/node_modules/webpack/lib/Cache.js:39:11
at /Users/sebastienlorber/Desktop/projects/next-auth/www/node_modules/webpack/lib/cache/IdleFileCachePlugin.js:66:9
at /Users/sebastienlorber/Desktop/projects/next-auth/www/node_modules/webpack/lib/Cache.js:88:6
at eval (eval at create (/Users/sebastienlorber/Desktop/projects/next-auth/www/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:30:1)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
You have webpack optimizations here:
configureWebpack(config) {
const generatedFilesDir = config.resolve.alias['@generated']
languages = utils.generateLunrClientJS(generatedFilesDir, options.languages);
// Ensure that algolia docsearch css is its own chunk
return {
optimization: {
splitChunks: {
cacheGroups: {
algolia: {
name: 'algolia',
test: /algolia\.css$/,
chunks: `all`,
enforce: true,
// Set priority higher than docusaurus single-css extraction
priority: 60,
},
},
},
},
};
},
Removing these optimizations makes the plugin work again on alpha 75, so I suggest to remove those for now to ensure everybody can upgrade.
Not sure why this does not work anymore though, nor why we have this error message.
Was also wondering why you need this optimization, as the algolia code/plugin is already in a distinct package. Maybe it’s a legacy optim?
Unrelated: the call to generateLunrClientJS
would probably be better in another lifecycle like contentLoaded()
(but in practice it is probably not very important).
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:10 (1 by maintainers)
Top GitHub Comments
A temporary workaround is to publish your own fork, or use something like patch-package to fix it locally
thanks 👍