Topic: Angular MDBA 4.3.1 showing circular dependency warning

sreedhar pro asked 6 years ago


Hi I am getting below warnings while running ng build using cli 1.3.1,Angular 4.2.1 WARNING in Circular dependency detected: chemruiappmdbatypescriptsfreemodalsmodal.service.ts -> chemruiappmdbatypescriptsfreemodalsmodalConta iner.component.ts -> chemruiappmdbatypescriptsfreemodalsmodal.service.ts WARNING in Circular dependency detected: chemruiappmdbatypescriptsfreemodalsmodalContainer.component.ts -> chemruiappmdbatypescriptsfreemodals modal.service.ts -> chemruiappmdbatypescriptsfreemodalsmodalContainer.component.ts WARNING in Circular dependency detected: chemruiappmdbatypescriptsproaccordioncomponentssb-item.ts -> chemruiappmdbatypescriptsproaccordionc omponentssqueezebox.ts -> chemruiappmdbatypescriptsproaccordioncomponentssb-item.ts WARNING in Circular dependency detected: chemruiappmdbatypescriptsproaccordioncomponentssqueezebox.ts -> chemruiappmdbatypescriptsproaccordioncomponentssb-item.ts -> chemruiappmdbatypescriptsproaccordioncomponentssqueezebox.ts WARNING in Circular dependency detected: chemruiappmdbatypescriptsproalertstoasttoast.component.ts -> chemruiappmdbatypescriptsproalertstoasttoast.service.ts -> chemruiappmdbatypescriptsproalertstoasttoast.component.ts WARNING in Circular dependency detected: chemruiappmdbatypescriptsproalertstoasttoast.service.ts -> chemruiappmdbatypescriptsproalertstoasttoast.component.ts -> chemruiappmdbatypescriptsproalertstoasttoast.service.ts

wkamir pro answered 6 years ago


This has less to do with @angular/cli and more to do with your code. There ARE circular references in it and this is not great. Altough TypeScript seems to manage for now, this should not be ignored. Also the production build is broken. "ng build --prod" throws a load of errors (version 4.3.1)

Rafał Rogulski free commented 6 years ago

ok, then why, when I do 'ng build' any of following error don't show up? I use angular-cli global 1.2.1, in project 1.0.0 and a quick start for mdb angular version 4.3.1. With 'ng build -prod' errors we working to fix it, and we probably will fix it to next release.

wkamir pro commented 6 years ago

Please take a look at the codefile "modal.service.ts". There is an import statement for "ModalComponent". If you take a look at modal.component.ts, there is an import for "ModalService" (which in turn imports ModalComponent). This is one of 6 or 7 circular references. It has nothing to do with the version of @angular/cli. The warnings are legitimate. (I hope I remember the names right - I'm not sitting in front of it right now, but I'm sure you will find the code)

Rafał Rogulski free answered 6 years ago


Hi, Try to update your global and local angular-cli in some version this bug is showing. Regards

cabir pro commented 6 years ago

same error here "devDependencies": { "@angular/cli": "1.3.2", "@angular/compiler-cli": "^4.0.0",

Jared Bratu pro commented 6 years ago

When I used the angular project from mdb-angular-pro-4.3.2.zip I did not receive the circular dependency warnings but I was getting: Your global Angular CLI version (1.4.1) is greater than your local version (1.2.6). The local Angular CLI version is used. To disable this warning use "ng set --global warnings.versionMismatch=false". So I ran the command to update angular: npm install --save-dev @angular/cli@latest And now when I ng serve the app the circular dependency warnings appear.

mog5808 pro answered 6 years ago


Can you share your package.json ?

FREE CONSULTATION

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

Status

Closed

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags