TypeError: The 'compilation' argument must be an instance of Compilation
See original GitHub issueBug description
Build is failed when using next-css plugin
Reproduction steps
- Add @zeit/next-css plugin to next.config.js
- import a css file in tsx component
- build
esbuild-loader will fail during build with TypeError: The 'compilation' argument must be an instance of Compilation
Environment
- esbuild-loader version: 2.9.2
- Webpack version: 5.24.2
- Operating System: macOS 10.15.7
- Node version: 14.4.0
- Package manager (npm/yarn/pnpm) and version: yarn 1.22.0
More info
Build is successful if next-css plugin is removed and also it works well with next-images plugin.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
The 'compilation' argument must be an instance of Compilation
The command I'm running is ng build . My angular.json is as follows: { "$schema": "./node_modules/@angular/cli/ ...
Read more >Webpack 5: The 'compilation' argument must be an ... - GitHub
TypeError: The 'compilation ' argument must be an instance of Compilation - JavascriptModulesPlugin.js:116 Function.
Read more >[webpack-cli] TypeError: The 'compilation' argument must be ...
When i run npm run dev i get this error: Copy Code [webpack-cli] TypeError: The 'compilation' argument must be an instance of Compilation....
Read more >build-storybook error: The 'compilation' argument must be an ...
TypeError: The 'compilation ' argument must be an instance of Compilation. To Reproduce I'm trying to run npm run build-storybook and getting the...
Read more >Fixing the "'compilation' argument must be an instance of ...
Fixing the "'compilation' argument must be an instance of Compilation" Duplicate Webpack Version Error ... The fix is simply to get all of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You’re getting the type error because esbuild-loader currently uses Webpack 4 types. I’m interested in supporting both Webpack 4 and 5 types in the future. It’s a known issue but I’ll leave this open till it’s addressed.
RE: is there some way to achieve more speed? esbuild touts 100x Running esbuild as a bundler vs esbuild-loader + Webpack are completely different. esbuild is highly optimized and is purely in Golang; you’ll get 100x if you let it handle your entire build. esbuild-loader is handled by Webpack (in JS runtime) and transforms are applied per-file so there’s a relatively large bottleneck that makes reaching those speeds impossible. It’s just that babel-loader/ts-loader/Terser are so much slower so esbuild-loader can offer pretty big speed gains by removing the bottleneck there.
RE: Do you plan for type-checking support? esbuild-loader is more or less just a Webpack wrapper for esbuild, so you’ll want to direct your question at esbuild instead. Looks like it’s already answered here but if you have a compelling case you can always open a feature request.
Keeping this open as I’d still like to resolve the Wepback 5 types issue