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.

Recent upgrade to angular v10 spots cyclic dependencies in Date Adapter #1284

See original GitHub issue

Describe the bug

As per title I found this error after upgrading to Angular v10.

Uncaught (in promise): Error: Cannot instantiate cyclic dependency! DateAdapter Error: Cannot instantiate cyclic dependency! DateAdapter at throwCyclicDependencyError (http://localhost:4200/vendor.js:70412:11) at R3Injector.hydrate (http://localhost:4200/vendor.js:76317:13) at R3Injector.get (http://localhost:4200/vendor.js:76143:33) at NgModuleRef$1.get (http://localhost:4200/vendor.js:89037:33) at Object.get (http://localhost:4200/vendor.js:87293:35) at getOrCreateInjectable (http://localhost:4200/vendor.js:68854:39) at Module.ɵɵdirectiveInject (http://localhost:4200/vendor.js:78825:12) at NodeInjectorFactory.CalendarNextViewDirective_Factory [as factory] (http://localhost:4200/vendor.js:138405:189) at getNodeInjectable (http://localhost:4200/vendor.js:68962:44) at instantiateAllDirectives (http://localhost:4200/vendor.js:73077:27) Error: Uncaught (in promise): Error: Cannot instantiate cyclic dependency! DateAdapter Error: Cannot instantiate cyclic dependency! DateAdapter at throwCyclicDependencyError (http://localhost:4200/vendor.js:70412:11) at R3Injector.hydrate (http://localhost:4200/vendor.js:76317:13) at R3Injector.get (http://localhost:4200/vendor.js:76143:33) at NgModuleRef$1.get (http://localhost:4200/vendor.js:89037:33) at Object.get (http://localhost:4200/vendor.js:87293:35) at getOrCreateInjectable (http://localhost:4200/vendor.js:68854:39) at Module.ɵɵdirectiveInject (http://localhost:4200/vendor.js:78825:12) at NodeInjectorFactory.CalendarNextViewDirective_Factory [as factory] (http://localhost:4200/vendor.js:138405:189) at getNodeInjectable (http://localhost:4200/vendor.js:68962:44) at instantiateAllDirectives (http://localhost:4200/vendor.js:73077:27) at resolvePromise (http://localhost:4200/polyfills.js:3904:39) at resolvePromise (http://localhost:4200/polyfills.js:3856:21) at http://localhost:4200/polyfills.js:3966:21 at ZoneDelegate.invokeTask (http://localhost:4200/polyfills.js:3505:35) at Object.onInvokeTask (http://localhost:4200/vendor.js:92230:33) at ZoneDelegate.invokeTask (http://localhost:4200/polyfills.js:3504:40) at Zone.runTask (http://localhost:4200/polyfills.js:3273:51) at drainMicroTaskQueue (http://localhost:4200/polyfills.js:3675:39) at ZoneTask.invokeTask [as invoke] (http://localhost:4200/polyfills.js:3590:25) at invokeTask(http://localhost:4200/polyfills.js:4727:18)

Minimal reproduction of the problem with instructions

not need

Screenshots

not need Versions

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

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
tveskagcommented, Jun 30, 2020

As per this comment, the deduping seems to be caused by the date-fns module in /date-adapters not having name or version. Simply adding some dummy name to the package.json file fixes this, eg:

(date-adapters/date-fns/package.json)

{
  "main": "./index.js",
  "typings": "./index.d.ts",
  "name": "not-date-fns"
}
2reactions
DanielMorales9commented, Jun 26, 2020

Thank you @mattlewis92 I’ve subscribed to the issue you mentioned and let you know the status of this once tested

Read more comments on GitHub >

github_iconTop Results From Across the Web

NG0200: Circular dependency in DI detected while ... - Angular
A cyclic dependency exists when a dependency of a service directly or indirectly depends on the service itself. For example, if UserService depends...
Read more >
WARNING in Circular dependency detected - Angular Cli
Removing the import doesn't help in this case. The circular dependency is caused by the calls to new Forms() and new CustomForms(). –...
Read more >
Changelog - Highcharts
View changelog for Highcharts, Highcharts Stock, Highcharts Maps, Highcharts Gantt. Go to the Download page to get the latest version. Highcharts. Highcharts ...
Read more >
Dependencies analysis | IntelliJ IDEA Documentation - JetBrains
Dependencies analysis. Last modified: 20 December 2022. If you have a large Java project with several modules that uses multiple libraries, any operation ......
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