The following warning is printed when building a plugin: > DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated. This appears to be coming from ConsoleRemotePlugin when running with `--trace-deprecation` enabled. I'm building the following plugin: https://github.com/spadgett/console-customization-plugin But I suspect it happens with any plugin. ``` yarn run v1.22.15 $ yarn clean && NODE_ENV=production NODE_OPTIONS=--trace-deprecation yarn ts-node node_modules/.bin/webpack $ rm -rf dist $ ts-node -O '{"module":"commonjs"}' node_modules/.bin/webpack (node:5651) [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 Compilation.updateAsset (/Users/sam/work/console-customization-plugin/node_modules/webpack/lib/Compilation.js:4241:22) at /Users/sam/work/console-customization-plugin/node_modules/src/webpack/ConsoleRemotePlugin.ts:81:19 at Hook.eval [as callAsync] (eval at create (/Users/sam/work/console-customization-plugin/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1) at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/sam/work/console-customization-plugin/node_modules/tapable/lib/Hook.js:18:14) at Compiler.emitAssets (/Users/sam/work/console-customization-plugin/node_modules/webpack/lib/Compiler.js:871:19) at /Users/sam/work/console-customization-plugin/node_modules/webpack/lib/Compiler.js:459:10 at processTicksAndRejections (internal/process/task_queues.js:77:11) ```
The warning is occurring on this line: https://github.com/openshift/console/blob/master/frontend/packages/console-dynamic-plugin-sdk/src/webpack/ConsoleRemotePlugin.ts#L81
1. clone latest console repo # git clone git:openshift/console.git; cd console 2. clone console-customization-plugin repo # git clone git:spadgett/console-customization-plugin.git # cd console-customization-plugin; yarn install 3. Run `yarn run build` in console-customization-plugin dir ~/go/src/github.com/openshift/console/console-customization-plugin/ [main] yarn run build yarn run v1.22.10 $ yarn clean && NODE_ENV=production yarn ts-node node_modules/.bin/webpack $ rm -rf dist $ ts-node -O '{"module":"commonjs"}' node_modules/.bin/webpack (node:4310) [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) assets by info 3.08 MiB [immutable] assets by path *.js 3.08 MiB assets by chunk 3 MiB (id hint: vendors) 4 assets assets by chunk 388 bytes (auxiliary id hint: vendors) 6 assets assets by path assets/*.jpg 1.53 MiB assets by status 1.17 MiB [big] asset assets/pfbg_992 575 KiB [emitted] [from: ../node_modules/@patternfly/react-styles/css/assets/images/pfbg_992] [big] (auxiliary id hint: vendors) asset assets/pfbg_768 354 KiB [emitted] [from: ../node_modules/@patternfly/react-styles/css/assets/images/pfbg_768] [big] (auxiliary id hint: vendors) asset assets/pfbg_2000.jpg 270 KiB [emitted] [from: ../node_modules/@patternfly/react-styles/css/assets/images/pfbg_2000.jpg] [big] (auxiliary id hint: vendors) asset assets/pfbg_576 191 KiB [emitted] [from: ../node_modules/@patternfly/react-styles/css/assets/images/pfbg_576] (auxiliary id hint: vendors) asset assets/pfbg_768.jpg 114 KiB [emitted] [from: ../node_modules/@patternfly/react-styles/css/assets/images/pfbg_768.jpg] (auxiliary id hint: vendors) asset assets/pfbg_576.jpg 65.9 KiB [emitted] [from: ../node_modules/@patternfly/react-styles/css/assets/images/pfbg_576.jpg] (auxiliary id hint: vendors) asset plugin-entry.js 8.7 KiB [emitted] [minimized] (name: console-customization) 1 related asset asset plugin-manifest.json 1.57 KiB [emitted] orphan modules 997 KiB [orphan] 604 modules runtime modules 21.4 KiB 13 modules built modules 3.83 MiB (javascript) 388 bytes (asset) 546 bytes (consume-shared) 336 bytes (share-init) [built] 327 modules WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). This can impact web performance. Assets: assets/pfbg_2000.jpg (270 KiB) assets/pfbg_768 (354 KiB) assets/pfbg_992 (575 KiB) 168-chunk-3391de88a16eeb636916.min.js (2.96 MiB) webpack 5.61.0 compiled with 1 warning in 17163 ms ✨ Done in 31.16s. From above output, we can still see following warning ``` (node:4310) [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) ``` moving back for confirmation
OpenShift has moved to Jira for its defect tracking! This bug can now be found in the OCPBUGS project in Jira. https://issues.redhat.com/browse/OCPBUGS-9018