Deprecation Warning on Webpack 5

See original GitHub issue

Expected 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
wosscommented, Sep 20, 2020

i’m still getting this for the versions:

"ts-node": "^8.10.2",
"typescript": "^4.0.2",
"webpack": "^5.0.0-beta.32",

the command is clear; node --trace-deprecation ../../node_modules/webpack/bin/webpack.js --mode=development --config webpack.dev.js since this is lerna monorepo and actual webpack is in the root

After 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

0reactions
johnnyreillycommented, Oct 15, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found