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

Angular 10 build warning - CommonJS or AMD dependencies #224

Open
clabough opened this issue Jul 6, 2020 · 2 comments
Open

Angular 10 build warning - CommonJS or AMD dependencies #224

clabough opened this issue Jul 6, 2020 · 2 comments

Comments

@clabough
Copy link

clabough commented Jul 6, 2020

Current Behavior

When using stacktrace-js in an Angular 10 project, the build process now displays the following errors:

WARNING in ...\Services\error-handler.service.ts depends on 'stacktrace-js'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in ...\node_modules\stacktrace-js\stacktrace.js depends on 'error-stack-parser'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in ...\node_modules\stacktrace-js\stacktrace.js depends on 'stacktrace-gps'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in ...\node_modules\stacktrace-js\stacktrace.js depends on 'stack-generator'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Steps to Reproduce (for bugs)

Import stacktrace-js like this in an Angular 10 project typescript file (e.g. service)

import * as StackTrace from "stacktrace-js";

Your Environment

  • stacktrace.js version: 2.0.2
@der-raist
Copy link

to supress this warning you could add an entry in your angular.json at path "projects/XXX/architect/build/options/allowedCommonJsDependencies"

"allowedCommonJsDependencies": [
    "stacktrace-js",
    "error-stack-parser",
    "stacktrace-gps",
    "stack-generator"
]

@clabough
Copy link
Author

@der-raist Thanks for the workaround. I saw that in the Angular docs in the links about the warning. I'm hoping that this package gets updated to ECMAScript modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants