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

Webpack 5 fails with TypeError or warns about COMPILATION_ASSETS #4

Open
ath0mas opened this issue Oct 15, 2020 · 2 comments
Open

Webpack 5 fails with TypeError or warns about COMPILATION_ASSETS #4

ath0mas opened this issue Oct 15, 2020 · 2 comments

Comments

@ath0mas
Copy link

ath0mas commented Oct 15, 2020

Given an existing config running with Webpack 4 and @ahrakio/witty-webpack-declaration-files,
as described in PR #1 the build runs fine but with a warning
DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
(webpack@4.44.2, webpack-cli@3.3.12)

Now with Webpack 5 the build fails:
TypeError: compiler.plugin is not a function
(webpack@5.1.2, webpack-cli@4.0.0)

[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_ASSETS_STAGE_*.
  • no solution found for this warning at the moment
@ath0mas
Copy link
Author

ath0mas commented Oct 15, 2020

Debugging with node --trace-deprecation node_modules/webpack/bin/webpack.js instead of webpack:

[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_ASSETS_STAGE_*.
    at outputFileToAsset (C:\dev\webpack-example\node_modules\ts-loader\dist\after-compile.js:216:35)
    at outputFilesToAsset (C:\dev\webpack-example\node_modules\ts-loader\dist\after-compile.js:224:13)
    at addDeclarationFilesAsAsset (C:\dev\webpack-example\node_modules\ts-loader\dist\after-compile.js:210:5)      
    at provideDeclarationFilesToWebpack (C:\dev\webpack-example\node_modules\ts-loader\dist\after-compile.js:206:9)
    at C:\dev\webpack-example\node_modules\ts-loader\dist\after-compile.js:30:9
    at Hook.eval [as callAsync] (eval at create (C:\dev\webpack-example\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:7:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\dev\webpack-example\node_modules\webpack\node_modules\tapable\lib\Hook.js:18:14)
    at C:\dev\webpack-example\node_modules\webpack\lib\Compiler.js:986:33
    at C:\dev\webpack-example\node_modules\webpack\lib\Compilation.js:2025:10
    at Hook.eval [as callAsync] (eval at create (C:\dev\webpack-example\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)

seems linked to TypeStrong/ts-loader#1196, more than this plugin, given the debug trace about ts-loader\dist\after-compile.js
(ts-loader 8.0.5)

@ath0mas
Copy link
Author

ath0mas commented Oct 20, 2020

ts-loader fixed previous warning in ts-loader\dist\after-compile.js with version 8.0.6 👍

but now same warning appears for this plugin in witty-webpack-declaration-files\src\index.js:

[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_ASSETS_STAGE_*.
    at C:\MyWorks\ns0m\witty-webpack-declaration-files\example\node_modules\@ns0m\witty-webpack-declaration-files\src\index.js:64:43
    at Array.forEach (<anonymous>)
    at C:\MyWorks\ns0m\witty-webpack-declaration-files\example\node_modules\@ns0m\witty-webpack-declaration-files\src\index.js:63:20
    at Hook.eval [as callAsync] (eval at create (C:\MyWorks\ns0m\witty-webpack-declaration-files\example\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\MyWorks\ns0m\witty-webpack-declaration-files\example\node_modules\webpack\node_modules\tapable\lib\Hook.js:18:14)
    at Compiler.emitAssets (C:\MyWorks\ns0m\witty-webpack-declaration-files\example\node_modules\webpack\lib\Compiler.js:739:19)
    at C:\MyWorks\ns0m\witty-webpack-declaration-files\example\node_modules\webpack\lib\Compiler.js:398:10
    at processTicksAndRejections (internal/process/task_queues.js:75:11)

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

1 participant