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: app.component.ts depends on 'date-fns/locale'. CommonJS or AMD dependencies can cause optimization bailouts. #2404

Closed
gabrielnemeth opened this issue Apr 10, 2021 · 2 comments · Fixed by #2339

Comments

@gabrielnemeth
Copy link

I've just installed the date-fs to my Angular v11 app, and I'm getting this warning: Warning: app.component.ts depends on 'date-fns/locale'. CommonJS or AMD dependencies can cause optimization bailouts. if I import locales like:

import {enUS as locale} from 'date-fns/locale';

I can make the warning go away if I'm adding allowedCommonJsDependencies into my angular.json file, but I really like to avoid using it that way.

@fturmel
Copy link
Member

fturmel commented Apr 12, 2021

Prob related to #2207. There are temporary workarounds in the thread and a pull request pending to fix the root cause (#2339)

@tan75
Copy link
Contributor

tan75 commented Apr 13, 2021

hi all,
the fix is on the way - see PR2339

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.

3 participants