DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.

See original GitHub issue

const HtmlWebpackPlugin = require(‘html-webpack-plugin’); const path = require(‘path’); const utils = require(‘./build/utils’) module.exports = { entry: path.resolve(__dirname, ‘src/index.tsx’), resolve: { extensions: [“.js”, “.ts”, “.jsx”, “.tsx”], alias: { “@”: path.join(__dirname, “src”) } }, optimization: { moduleIds: ‘hashed’ // webapck5替代 4中的 new webpack.NamedModulesPlugin(), }, module:{ rules: [ { test: /.(js|jsx|ts|tsx)$/, use: [“babel-loader”, “ts-loader”], exclude: /node_modules/ }, { test: /.scss$/, exclude: /node_modules/, use: [ ‘style-loader’, “css-loader”, “sass-loader” ] }, { test: /.css$/, use: [‘style-loader’,‘css-loader’] }, { test: /.(png|svg|jpg|gif)$/, use: [ ‘file-loader’ ] } ] }, plugins: [ // new CleanWebpackPlugin(), // new webpack.HotModuleReplacementPlugin(), new HtmlWebpackPlugin({ templateParameters: { PUBLIC_URL: ‘static’, title: ‘react app template’
}, filename: ‘index.html’, template: utils.resolve(‘public/index.html’), inject: true }) ] }

Something went wrong: [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_*. (Use node --trace-deprecation ... to show where the warning was created)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

18reactions
bebrawcommented, Nov 16, 2020

Make sure you are using the next version of html-webpack-plugin (i.e. html-webpack-plugin@next) as it has support for webpack 5.

7reactions
livelyPengcommented, Nov 16, 2020

@bebraw Thank you for solving the problem! npm i --save-dev html-webpack-plugin@next ,that will do 。 “html-webpack-plugin”: “^5.0.0-alpha.14”,

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compilation.assets will be frozen in future, all modifications ...
I am working on a react project and when I updated webpack 4.44.2 to 5.4.0 I am getting ...
Read more >
[DEP_WEBPACK_COMPILATION_ASSETS ... - GitHub
[DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated. #1523.
Read more >
2020428 – Dynamic Plugins: Deprecation warning building ...
The following warning is printed when building a plugin: > DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated ...
Read more >
Compilation.assets will be frozen in future, all modifications ...
Coding example for the question DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated-Reactjs.
Read more >
singleentryplugin was renamed to entryplugin - You.com
... DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated. BREAKING CHANGE: No more changes should happen to ...
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