Deprecation Warning on Webpack 5
See original GitHub issueExpected Behaviour
Clean output without deprecation warning.
Actual Behaviour
After webpack update (from v4 to v5) I’m getting deprecation warnings in my console.
(node:7361) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.modules was changed from Array to Set (using Array method 'reduce' is deprecated)
(node:41349) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
Steps to Reproduce the Problem
Using tracing:
node --trace-deprecation node_modules/webpack/bin/webpack.js
Output:
(node:41650) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.modules was changed from Array to Set (using Array method 'reduce' is deprecated)
at Set.set.<computed> [as reduce] (/Users/.../myproject/node_modules/webpack/lib/util/deprecation.js:78:4)
at determineModules (/Users/.../myproject/node_modules/ts-loader/dist/after-compile.js:58:32)
(node:41650) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
at /Users/.../myproject/node_modules/ts-loader/dist/after-compile.js:140:45
at Array.forEach (<anonymous>)
Environment
Node.js v12.16.2
webpack@5.0.0-beta.16
ts-loader@7.0.5
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top Results From Across the Web
deprecation warning [DEP_WEBPACK_MODULE_ERRORS ...
So any patch should support webpack 4 and webpack 5. You can see a feature testing approach in the codebase that does this...
Read more >Webpack 5 Deprecation Warnings - Edgio Community Forums
assets will be frozen in future, all modifications are deprecated. BREAKING CHANGE: No more changes should happen to Compilation.assets after ...
Read more >Resolve Webpack 5.9.0 deprecation calls ... - Stack Overflow
I am using it like so (which I learned from following: https://survivejs.com/webpack/styling/eliminating-unused-css/):
Read more >To v5 from v4 - webpack
As webpack 5 removes all deprecated features, make sure there's no webpack deprecation warnings during the build in order to proceed.
Read more >singleentryplugin was renamed to entryplugin - You.com
hooks` instead (node:29408) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead /tmp/my-project/node_modules/html-webpack ...
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
i’m still getting this for the versions:
the command is
clear; node --trace-deprecation ../../node_modules/webpack/bin/webpack.js --mode=development --config webpack.dev.jssince this is lerna monorepo and actual webpack is in the rootAfter reading comments here and other links, i couldn’t figure out what is actual solution. is there anything i can do? are my package versions incompatible
Some deprecations have been fixed - some still need to be. All help appreciated! Locking this issue - please continue conversation here instead: https://github.com/TypeStrong/ts-loader/issues/1196