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

DeprecationWarning: afterOptimizeChunkAssets is deprecated #60

Open
bluesurfer opened this issue Feb 19, 2021 · 3 comments
Open

DeprecationWarning: afterOptimizeChunkAssets is deprecated #60

bluesurfer opened this issue Feb 19, 2021 · 3 comments

Comments

@bluesurfer
Copy link

Not sure if it's worth opening an issue for this...

Anyway.. with Webpack 5.23.0 I get this DeprecationWarning:

(node:98245) [DEP_WEBPACK_COMPILATION_AFTER_OPTIMIZE_CHUNK_ASSETS] DeprecationWarning: afterOptimizeChunkAssets is deprecated (use Compilation.hook.processAssets instead and use one of Compilation.PROCESS_ASSETS_STAGE_* as stage option)
    at /.../node_modules/media-query-plugin/src/plugin.js:243:60
    at Hook.eval [as call] (eval at create (/.../node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:9:1)
    at Hook.CALL_DELEGATE [as _call] (/.../node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/.../node_modules/webpack/lib/Compiler.js:992:30)
    at /.../node_modules/webpack/lib/Compiler.js:1035:29
    at Hook.eval [as callAsync] (eval at create (/.../node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/.../node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.compile (/.../node_modules/webpack/lib/Compiler.js:1030:28)
    at /.../node_modules/webpack/lib/Compiler.js:473:12
    at Compiler.readRecords (/.../node_modules/webpack/lib/Compiler.js:871:11)
@blondinekatze
Copy link

The same problem with Webpack 4.46.0

@scofield-ua
Copy link

I received such error.
I had to rollback to v1.4.0.

(node:36) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: chunk.files was changed from Array to Set (using Array method 'reduce' is deprecated)
Error: Chunk.modulesSizeThere was no ChunkGraph assigned to the Chunk for backward-compat (Use the new API)
    at /var/www/node_modules/media-query-plugin/node_modules/webpack/lib/ChunkGraph.js:1621:12
    at deprecated (internal/util.js:89:15)
    at Function.getChunkGraphForChunk (/var/www/node_modules/media-query-plugin/node_modules/webpack/lib/ChunkGraph.js:1631:10)
    at Chunk.modulesSize (/var/www/node_modules/media-query-plugin/node_modules/webpack/lib/Chunk.js:299:33)
    at /var/www/node_modules/webpack/lib/Stats.js:660:18
    at Array.map (<anonymous>)
    at Stats.toJson (/var/www/node_modules/webpack/lib/Stats.js:633:36)
    at CleanWebpackPlugin.handleDone (/var/www/node_modules/clean-webpack-plugin/dist/clean-webpack-plugin.js:155:26)
    at /var/www/node_modules/clean-webpack-plugin/dist/clean-webpack-plugin.js:100:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/var/www/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
    at AsyncSeriesHook.lazyCompileHook (/var/www/node_modules/tapable/lib/Hook.js:154:20)
    at /var/www/node_modules/webpack/lib/Compiler.js:304:22
    at Compiler.emitRecords (/var/www/node_modules/webpack/lib/Compiler.js:499:39)
    at /var/www/node_modules/webpack/lib/Compiler.js:298:10
    at /var/www/node_modules/webpack/lib/Compiler.js:485:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/var/www/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at AsyncSeriesHook.lazyCompileHook (/var/www/node_modules/tapable/lib/Hook.js:154:20)
    at /var/www/node_modules/webpack/lib/Compiler.js:482:27
    at /var/www/node_modules/neo-async/async.js:2818:7
    at done (/var/www/node_modules/neo-async/async.js:3522:9)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/var/www/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at /var/www/node_modules/webpack/lib/Compiler.js:464:33
    at /var/www/node_modules/media-query-plugin/node_modules/graceful-fs/graceful-fs.js:61:14
    at /var/www/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqCallback.oncomplete (fs.js:163:23)
(node:36) [DEP_WEBPACK_CHUNK_MODULES_SIZE] DeprecationWarning: Chunk.modulesSize: Use new ChunkGraph API
  • Webpack - v4.46.0
  • media-query-plugin - v1.5.0

@meiyasan
Copy link

meiyasan commented Dec 21, 2022

Is there already some plan to fix it in Webpack 5 ? @SassNinja

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