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

Failures when running with webpack 5.x which is used by Angular 13 #33

Closed
barclay-reg opened this issue Jan 27, 2022 · 4 comments · Fixed by #55
Closed

Failures when running with webpack 5.x which is used by Angular 13 #33

barclay-reg opened this issue Jan 27, 2022 · 4 comments · Fixed by #55

Comments

@barclay-reg
Copy link

barclay-reg commented Jan 27, 2022

using cyclonedx\webpack-plugin version 1.0.1 fails with angular cli 13 (which uses webpack 5.x)

[INFO] (node:23556) [DEP_WEBPACK_MODULE_ISSUER] DeprecationWarning: Module.issuer: Use new ModuleGraph API
[INFO] (Use `node --trace-deprecation ...` to show where the warning was created)
[INFO] Error: Module.issuerThere was no ModuleGraph assigned to the Module for backward-compat (Use the new API)
[INFO]     at C:\dev\dev\co\platform-model-hub_intellij_1\platform-model-hub\model-hub-user-interface\node_modules\webpack\lib\ModuleGraph.js:814:12
[INFO]     at deprecated (internal/util.js:89:15)
[INFO]     at Function.getModuleGraphForModule (C:\dev\dev\co\platform-model-hub_intellij_1\platform-model-hub\model-hub-user-interface\node_modules\webpack\lib\ModuleGraph.js:824:10)
[INFO]     at NormalModule.get issuer [as issuer] (C:\dev\dev\co\platform-model-hub_intellij_1\platform-model-hub\model-hub-user-interface\node_modules\webpack\lib\Module.js:279:22)
[INFO]     at buildBom (C:\dev\dev\co\platform-model-hub_intellij_1\platform-model-hub\model-hub-user-interface\node_modules\@cyclonedx\webpack-plugin\src\webpack-plugin\bomGenerator.js:53:29)
[INFO]     at resolveComponents (C:\dev\dev\co\platform-model-hub_intellij_1\platform-model-hub\model-hub-user-interface\node_modules\@cyclonedx\webpack-plugin\src\webpack-plugin\bomGenerator.js:174:11)
[INFO]     at generateBom (C:\dev\dev\co\platform-model-hub_intellij_1\platform-model-hub\model-hub-user-interface\node_modules\@cyclonedx\webpack-plugin\src\bom\index.js:37:9)
[INFO]     at C:\dev\dev\co\platform-model-hub_intellij_1\platform-model-hub\model-hub-user-interface\node_modules\@cyclonedx\webpack-plugin\src\webpack-plugin\index.js:72:26
[INFO]     at new Promise (<anonymous>)
[INFO]     at CycloneDxWebpackPlugin.emitBom (C:\dev\dev\co\platform-model-hub_intellij_1\platform-model-hub\model-hub-user-interface\node_modules\@cyclonedx\webpack-plugin\src\webpack-plugin\index.js:70:10)
[INFO]     at Hook.eval [as callAsync] (eval at create (C:\dev\dev\co\platform-model-hub_intellij_1\platform-model-hub\model-hub-user-interface\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:27:17)
[INFO]     at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\dev\dev\co\platform-model-hub_intellij_1\platform-model-hub\model-hub-user-interface\node_modules\tapable\lib\Hook.js:18:14)
[INFO]     at Compiler.emitAssets (C:\dev\dev\co\platform-model-hub_intellij_1\platform-model-hub\model-hub-user-interface\node_modules\webpack\lib\Compiler.js:873:19)
[INFO]     at C:\dev\dev\co\platform-model-hub_intellij_1\platform-model-hub\model-hub-user-interface\node_modules\webpack\lib\Compiler.js:461:10
[INFO]     at processTicksAndRejections (internal/process/task_queues.js:75:11)
@barclay-reg
Copy link
Author

barclay-reg commented Feb 1, 2022

first mitigation found: activate compat mode in webpack. Add the following to your webpack config

module.exports = {
  //...
  experiments: {
    backCompat: true,
  },
};

see https://webpack.js.org/configuration/experiments/#experimentsbackcompat

@jkowalleck
Copy link
Member

thanks for the report, @barclay-reg .

could cou create an example project and showcase the issue?
Maybe pullrequest that example as an integration test? see https://github.com/CycloneDX/cyclonedx-webpack-plugin/tree/master/tests/integration

@jkowalleck
Copy link
Member

was able to reproduce the issue.
see #55

@barclay-reg
Copy link
Author

Many thanks for the heads up :)

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

Successfully merging a pull request may close this issue.

2 participants