TypeError: The 'compilation' argument must be an instance of Compilation
darreola opened this issue · 7 comments
- Manifest Plugin Version: 3.1.1
- Webpack Version: 5.38.0
- Operating System (or Browser): Windows
- Node Version: v15.13.0
- Link to reproduction (
⚠️ read below): - I am using nvm 1.1.7 maybe this can help
webpack.config.js
`const path = require('path');
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
module.exports = {
entry: {
'app': './resources/js/app.js'
},
output: {
path: path.resolve('./static/build'),
filename: '[name].[chunkhash].js',
clean: true
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.common.js'
}
},
module:{
rules: [
{
test: /.(png|jpg|ttf|eot|svg|woff(2)?)(?[a-z0-9]+)?$/,
loader: 'url-loader',
},
{
test: /.vue$/,
loader: 'vue-loader'
},
{
test: /.(sa|c|sc)ss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
{
loader: 'sass-loader',
options: {
sassOptions: {
fiber: require('fibers')
}
}
}
]
},
]
},
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractPlugin({
filename: '[name].[chunkhash].css',
chunkFilename: '[id].css'
}),
new WebpackManifestPlugin({
publicPath : 'build/'
})
],
optimization: {
minimize: process.env.NODE_ENV === 'production',
minimizer: [
new CssMinimizerPlugin(),
],
},
};`
package.json
{ "name": "gus", "version": "1.0.0", "main": "index.js", "scripts": { "dev": "npm run development", "development": "webpack --progress --mode=development", "watch": "webpack --watch --watch-poll --progress --mode=development", "prod": "npm run production", "production": "webpack --progress --mode=production" }, "author": "", "license": "ISC", "keywords": [], "description": "", "dependencies": { "@adapttive/vue-markdown": "^4.0.1", "@fortawesome/fontawesome-free": "^5.15.2", "axios": "^0.21.1", "bootstrap": "^4.6.0", "css-loader": "^3.6.0", "css-minimizer-webpack-plugin": "^1.3.0", "date-fns": "^2.19.0", "date-fns-tz": "^1.1.4", "fibers": "^5.0.0", "file-loader": "^6.2.0", "jquery": "^3.5.1", "mini-css-extract-plugin": "^1.6.0", "mitt": "^2.1.0", "node-sass": "^4.14.1", "popper.js": "^1.16.1", "sass-loader": "^9.0.3", "url-loader": "^4.1.1", "velocity-animate": "^2.0.6", "vue": "^2.6.12", "vue-loader": "^15.9.6", "vue-scrollto": "^2.20.0", "vue-style-loader": "^4.1.2", "vue-template-compiler": "^2.6.12", "vue2-datepicker": "^3.9.0", "vuedraggable": "^2.24.3", "vuetable-3": "^3.3.3", "webpack": "^5.38.0", "webpack-cli": "^4.7.0", "webpack-manifest-plugin": "^3.1.1" } }
Expected Behavior
Actual Behavior
Additional Information
sorry about my bad english
I am trying to change from webpack 4 to 5 when i use npm run dev all seems fine but when i add the WebpackManifestPlugin in plugins i get the error in the image
I understand that English is not your first language and that it may be difficult, however there are lots of translation services available these days. your issue is being closed because you did not follow the guidance in the issue template which stated we don't offer support here, and you also did not follow the instructions for a valid reproduction if you are attempting to file a bug.
I resolve the issue, well i can not be called resolved. This errors only appear when i use the power shell i dont know why but when i run in the cmd or git bash it works but the problem persists in power shell i dont know why.
@darreola, for me it was installed as a package inside another package, because of that when the getCompilationHooks
runs it's returning an error. Because there is no compilation instance registered inside the package itself or they are conflicting not sure about it.
In your case, If it is working in other terminals I think you can try to clean the cache(npm clear cache
), and make a clean install the packages(npm ci
).
Same issue.
@darreola, for me it was installed as a package inside another package, because of that when the
getCompilationHooks
runs it's returning an error. Because there is no compilation instance registered inside the package itself or they are conflicting not sure about it.In your case, If it is working in other terminals I think you can try to clean the cache(
npm clear cache
), and make a clean install the packages(npm ci
).
The problem persist i try:
rm -r node_modules
npm cache clean --force
npm ci
but got the same error with power shell
Having the same issue with a v4 to v5 webpack upgrade…
"me too" replies aren't welcome in this repo. please open a new issue adhering to the instructions in the issue template, or use the reaction buttons on the original post to add support. Locking this issue as nothing constructive is coming from replies.