next.js: Bug Compiling webpackbar
Bug report
Describe the bug
When i try to compile on Ubuntu 16.04 i got this:
Compiling
● client
● server █████████████████████████ compiling (0%)
/home/ubuntu/website/node_modules/next/node_modules/webpackbar/node_modules/webpack/lib/ProgressPlugin.js:205
compilation.hooks.addEntry.tap("ProgressPlugin", entryAdd);
^
TypeError: Cannot read property 'tap' of undefined
at compiler.hooks.compilation.tap.compilation (/home/ubuntu/website/node_modules/next/node_modules/webpackbar/node_modules/webpack/lib/ProgressPlugin.js:205:32)
at SyncHook.eval [as call] (eval at create (/home/ubuntu/website/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:9:1)
at SyncHook.lazyCompileHook (/home/ubuntu/website/node_modules/tapable/lib/Hook.js:154:20)
at Compiler.newCompilation (/home/ubuntu/website/node_modules/next/node_modules/webpack/lib/Compiler.js:498:26)
at hooks.beforeCompile.callAsync.err (/home/ubuntu/website/node_modules/next/node_modules/webpack/lib/Compiler.js:534:29)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/ubuntu/website/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/home/ubuntu/website/node_modules/tapable/lib/Hook.js:154:20)
at Compiler.compile (/home/ubuntu/website/node_modules/next/node_modules/webpack/lib/Compiler.js:529:28)
at compiler.hooks.watchRun.callAsync.err (/home/ubuntu/website/node_modules/next/node_modules/webpack/lib/Watching.js:77:18)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/ubuntu/website/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:24:1)
at AsyncSeriesHook.lazyCompileHook (/home/ubuntu/website/node_modules/tapable/lib/Hook.js:154:20)
at Watching._go (/home/ubuntu/website/node_modules/next/node_modules/webpack/lib/Watching.js:40:32)
at Watching.compiler.readRecords.err (/home/ubuntu/website/node_modules/next/node_modules/webpack/lib/Watching.js:32:9)
at Array.inputFileSystem.stat.err (/home/ubuntu/website/node_modules/next/node_modules/webpack/lib/Compiler.js:401:20)
at Storage.finished (/home/ubuntu/website/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
at provider (/home/ubuntu/website/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9)
error Command failed with exit code 1.
To Reproduce
put “webpack”: “^4.25.1” in your package.json at dependencies next build
Expected behavior
Compiling…
System information
- OS: Ubuntu 16.04
- Version of Next.js: 7.0.2
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 15 (6 by maintainers)
Commits related to this issue
- fix: https://github.com/zeit/next.js/issues/5650\#issuecomment-438932678 — committed to danielwii/asuna-admin by danielwii 8 years ago
For my temporary solution (at least until zeit fix it) in my package.json file I remove “^” character for webpack module. ex: “webpack”: “^4.23.1” become “webpack”: “4.23.1”
Note: make sure you also not use webpack 4.25.1, (use lower version instead)
You shouldn’t install
"webpack"yourself, it’s a dependency on Next.js. I’m beginning to think we might have to soft/hard fail when users do this, it makes no sense to add it and can only cause issues.What if you need to add a webpack builtin plugin to next.config.js?
There are many reasons someone might want webpack in their codebase when using next.js.
On Wed 21. Nov 2018 at 09:30, Tim Neutkens notifications@github.com wrote:
I had the same problem. Upgrading to
next@canaryworks for me.I’ve just stumbled across this issue after installing Docz into a next project to handle my component documentation 😢
I haven’t manually installed webpack, but this is still an issue if you depend on another framework that has its own webpack tooling. It would be nice if Docz and Next played nice together.