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

ERROR in TypeError: The 'compilation' argument must be an instance of Compilation #1535

Closed
tw19920521 opened this issue Oct 20, 2020 · 6 comments

Comments

@tw19920521
Copy link

ERROR in TypeError: The 'compilation' argument must be an instance of Compilation

  • JavascriptModulesPlugin.js:118 getCompilationHooks
    [webpack_demo]/[webpack]/lib/javascript/JavascriptModulesPlugin.js:118:10

  • CommonJsChunkFormatPlugin.js:30 compiler.hooks.thisCompilation.tap.compilation
    [webpack_demo]/[webpack]/lib/javascript/CommonJsChunkFormatPlugin.js:30:19

  • Hook.js:14 Hook.CALL_DELEGATE [as _call]
    [npm]/[webpack]/[tapable]/lib/Hook.js:14:14

  • Compiler.js:915 Compiler.newCompilation
    [npm]/[webpack]/lib/Compiler.js:915:30

  • Compiler.js:957 hooks.beforeCompile.callAsync.err
    [npm]/[webpack]/lib/Compiler.js:957:29

  • Hook.js:18 Hook.CALL_ASYNC_DELEGATE [as _callAsync]
    [npm]/[webpack]/[tapable]/lib/Hook.js:18:14

  • Compiler.js:952 Compiler.compile
    [npm]/[webpack]/lib/Compiler.js:952:28

  • Compiler.js:477 Compiler.runAsChild
    [npm]/[webpack]/lib/Compiler.js:477:8

webpack 5.0.0 compiled with 1 error in 1586 ms

@tw19920521
Copy link
Author

so? How to solve

@tw19920521
Copy link
Author

const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'index.html'),
}),
],

@csvan
Copy link

csvan commented Oct 21, 2020

@tw19920521 this plugin is not fully compatible with Webpack 5 yet, see #1527

@Shakeskeyboarde
Copy link

See also this issue with discussion: #1451

@jantimon
Copy link
Owner

duplicate of #1451

@jantimon
Copy link
Owner

jantimon commented Nov 1, 2020

Probably fixed in [email protected] please repoen this issue if it's not fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants