Topic: Warning: mdb-calendar.js depends on 'date-fns'

ammi pro asked 2 years ago

I use Angular 11.2.14 and mdb-calendar 11.1.0 When I compile project, I see:

Warning: C:\MyProject\node_modules\mdb-calendar__ivy_ngcc__\fesm2015\mdb-calendar.js depends on 'date-fns'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see:

How can it be resolved?

Arkadiusz Idzikowski staff commented 2 years ago

@ammi It looks like the problem is caused by one of our external dependencies. This may result in a slightly bigger size of app build, but it should not in any way affect how the plugin works. We will take a closer look at that and see if we can add a solution to this problem on our end.

Arkadiusz Idzikowski staff answered 2 years ago

It looks like we would have to use a new major version of date-fns dependency (which has a lot of breaking changes) to fix this problem. We are now giving more priority to fixing bugs in the library, for now, please add this dependency to the list of allowed commonJs dependencies as suggested in the Angular documentation:

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: MDB4 11.1.0
  • Device: Desktop
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: Yes