question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular version 10 - CommonJS import warnings

See original GitHub issue

Describe the bug

When building with the new angular version 10 angular-calendar triggers several warnings caused by using CommonJS dependencies instead of ecmascript module.

For example: .../app.module.ts depends on angular-calendar/date-adapters/date-fns. CommonJS or AMD dependencies can cause optimization bailouts.

You can read more about why this might be a problem at angular.io. I was wondering wether this could be fixed as it may improve bundle sizes significantly when building.

Minimal reproduction of the problem with instructions

Update project to angular 10.0 and run ng build.

Screenshots

Versions

  • @angular/core: 10.0.0
  • angular-calendar: 0.28.16
  • Browser name and version: any

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
manu2495commented, Sep 12, 2020

nice ! it works for me right now

2reactions
mattlewis92commented, Sep 12, 2020

Thank you so much. The update did remove so many warnings. There is only one warning that’s remaining though.

WARNING in frontend\node_modules\angular-draggable-droppable__ivy_ngcc__\fesm2015\angular-draggable-droppable.js depends on ‘@m attlewis92/dom-autoscroller’. CommonJS or AMD dependencies can cause optimization bailouts.

I’ve just noticed that as well when testing, please give 0.28.18 a go, it should get rid of it 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix CommonJS or AMD dependencies can cause optimization ...
CommonJS or AMD dependencies can cause optimization bailouts. By importing from the root module instead, the warning is no longer present during ...
Read more >
Warnings about CommonJS imports | angular 10 new features
Hello Friends,Welcome to Angular 10 full tutorial by sahosoft solutions.Please register on www.sahosoft.com for Angular online class with ...
Read more >
Angular 10 is available and here's what you should know ...
Starting from Angular v10, CommonJS import warnings alert developers when a dependency packaged with CommonJS could result in larger, ...
Read more >
Get to know the new Angular version 10! - HostArmada
Angular 10 includes warnings for CommonJS imports, which will alert you when a dependency package with CommonJS may lead to more extensive and...
Read more >
Version 10 of Angular Now Available | by Stephen Fluin
Version 10.0.0 is here! ... Warnings about CommonJS imports ... Starting with version 10, we now warn you when your build pulls in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found