-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
Still got DeprecationWarning on Webpack 5 #1196
Comments
There may be other deprecation warnings that still need remedying. We've had 2 contributions to remedy this so far, we'd happily welcome more ❤️🌻 |
I am using webpack 5.1.3 and ts-loader 8.0.5 and not getting any deprecation warnings. Maybe you could try again with 5.1.3 and if you are still getting deprecation warnings post a minimal repository which demonstrates the issue. |
@appzuka I have the same kind of trace for a simple build with declaration, like described in ahrakio/witty-webpack-declaration-files#4. |
@ath0mas, Thanks for the info. I see that the warning occurs when The warning comes when makeAfterCompile is called from instances.js, which happens twice: Line 346 in 6d8d601
Line 397 in 6d8d601
It is not quite as simple as replacing the afterCompile hook with afterProcessAssets as the first is a compiler hook and the second is a compilation hook. I'll try to take a look at a solution when I have time but if anyone else wants to have a go hopefully this is helpful. |
(taking a step back from the webpack plugin example I linked previously)
|
Thanks for doing some investigation @appzuka - that's very helpful 🌻 |
Currently, ts-loader gives webpack@^4.5.0 as a dev dependency and all tests are run under webpack 4. I believe I have a fix for this issue but it will fail under webpack 4. We can put a switch in the code similar to:
I have not yet fully tested this but I believe it may fix this issue. I see a problem that the new code will not be tested at all when you run I guess in an ideal world the tests may be run under multiple versions of webpack and typescript but I can see this could be complex. An alternative would be to make a new major version, ts-loader@9 which is only for webpack 5. What are your thoughts on supporting both webpack 4 and webpack 5? |
Hey @appzuka, Thanks for your thoughts.
Ideally we'll have ts-loader support both webpack 4 and 5 for some time. However, there's some caveats with that. We have 2 test packs:
Comparison tests look at the output from webpack, that differs from version to version and so the comparison test pack will always be hard bound to one webpack version. Incidentally, we only run / maintain the comparison test pack for the latest version of TypeScript also. Anything else would be too expensive in terms of human power. There's only so much time! Execution tests transform TypeScript to JavaScript and execute tests in Karma. These are very reliable and should work regardless of TypeScript version or webpack version I think. So I'd be keen to implement this and amend our test pack so it runs with webpack 5 in that context. Longer term, when webpack 5 is more established, we'll probably do a major changes version (as you suggest) which drops support for webpack 4 entirely. Older versions of |
No more warning using version 8.0.6: perfect! 💯 |
Well done @appzuka! |
I'm already update deps to latest but still get the deprecation warinning. Does the problem need to be fixed? Or just add the flag "--no-deprecation" to disable it.
environment:
commands:
The text was updated successfully, but these errors were encountered: