symfony / webpack-encore

A simple but powerful API for processing & compiling assets built around Webpack
https://symfony.com/doc/current/frontend.html
MIT License
2.23k stars 197 forks source link

Deprecation during compiling with 1.0.0 #913

Closed garak closed 3 years ago

garak commented 3 years ago

I just upgraded from 0.33 to 1.0, and while compiling I'm getting this:

node_modules/.bin/encore dev --watch Running webpack ... (node:295) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated. BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation. Do changes to assets earlier, e. g. in Compilation.hooks.processAssets. Make sure to select an appropriate stage from Compilation.PROCESS_ASSETSSTAGE*. (Use node --trace-deprecation ... to show where the warning was created) DONE Compiled successfully in 6989ms

stof commented 3 years ago

Can you please run the command with node --trace-deprecation as suggested so that we can see where it comes from ? Also, are you applying custom webpack plugins in your webpack config ? If yes, are these plugins updated to support webpack 5 properly ?

garak commented 3 years ago

Unfortunately, I can't recall where it happened. I tried with all my recent projects and can't find deprecation again. By the way, the only plugin I use everywhere is copy-webpack-plugin.

If you think there's no value, feel free to close.

weaverryan commented 3 years ago

Feel free to re-open if you spot it again - this type of things is definitely very possible :).

Cheers!

lobodol commented 3 years ago

Hi there,

just to add my contribution, I've got the same error while upgrading from 0.24 to 1.0.0.

In my case, it looks like the imagemin-webpack-plugin (^2.4.2) is responsible for the error. Indeed, when I remove the lines below the error disappeared :

let ImageminPlugin    = require('imagemin-webpack-plugin').default;
Encore.addPlugin(new ImageminPlugin({
    test: /\.(jpe?g|png|gif|svg)$/i,
    disable: !Encore.isProduction()
})

There is an open issue for this : https://github.com/Klathmon/imagemin-webpack-plugin/issues/116

Regards