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

Warning: CommonJS or AMD dependencies can cause optimization bailouts #99

Open
kevinrobertandrews opened this issue Oct 25, 2021 · 2 comments

Comments

@kevinrobertandrews
Copy link

Warning: projects/app.module.ts depends on 'ngx-google-places-autocomplete'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

I looked up how to resolve this issue and it seems that I could just disable the warning or make an issue here. Is there a way this project can export ECMAScript modules?

@AmirSavand
Copy link

AmirSavand commented Nov 16, 2021

This warning has been there since angular 9 or 10. Need to export to es2017.

I have a library for angular and I had CommonJS as well and got the warning. I changed tsconfig.json to this and fixed it.

    "target": "ES2017",
    "module": "ES2020",
    "moduleResolution": "node",

@shadyabouelmakarem
Copy link

I have the same issue and after looking it up I also found the same thing:
1- Either disable the warning by adding allowedCommonJsDependencies to the angular.json and adding the module to it.
2- Or wait for the author to make the module ECMAScript compatible.

Hope to hear any update on this.

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

3 participants