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.

A bug after apply routing of Angular 9.1.1

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/9.1.1

Description

The error appeared after adding routing.

I read a book on angular: routing (https://angular.io/start/start-routing) and followed the steps to build the application, but this error crashed every time. Thank you

πŸ”₯ Exception or Error



 ERROR Error: Uncaught (in promise): Error: ASSERTION ERROR: Type passed in is not ComponentType, it does not have 'Ι΅cmp' property.
Error: ASSERTION ERROR: Type passed in is not ComponentType, it does not have 'Ι΅cmp' property.
    at throwError (core.js:1335)
    at assertComponentType (core.js:2934)
    at ComponentFactoryResolver$1.resolveComponentFactory (core.js:33795)
    at RouterOutlet.activateWith (router.js:8939)
    at ActivateRoutes.activateRoutes (router.js:4047)
    at router.js:3984
    at Array.forEach (<anonymous>)
    at ActivateRoutes.activateChildRoutes (router.js:3979)
    at ActivateRoutes.activate (router.js:3842)
    at MapSubscriber.project (router.js:3815)
    at resolvePromise (zone-evergreen.js:798)
    at resolvePromise (zone-evergreen.js:750)
    at zone-evergreen.js:860
    at ZoneDelegate.invokeTask (zone-evergreen.js:399)
    at Object.onInvokeTask (core.js:41442)
    at ZoneDelegate.invokeTask (zone-evergreen.js:398)
    at Zone.runTask (zone-evergreen.js:167)
    at drainMicroTaskQueue (zone-evergreen.js:569)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:484)
    at invokeTask (zone-evergreen.js:1621)

🌍 Your Environment

Angular Version:




{
  "name": "my-app",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~9.1.1",
    "@angular/common": "~9.1.1",
    "@angular/compiler": "~9.1.1",
    "@angular/core": "~9.1.1",
    "@angular/forms": "~9.1.1",
    "@angular/platform-browser": "~9.1.1",
    "@angular/platform-browser-dynamic": "~9.1.1",
    "@angular/router": "~9.1.1",
    "rxjs": "~6.5.4",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.901.1",
    "@angular/cli": "~9.1.1",
    "@angular/compiler-cli": "~9.1.1",
    "@angular/language-service": "~9.1.1",
    "@types/node": "^12.11.1",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.4.1",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~3.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "~5.4.3",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~3.8.3"
  }
}

Anything else relevant?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
dvlascommented, Apr 18, 2020

The ProductDetailsComponent is missing the @Component decorator and as @mlc-mlapis pointed out, it’s not listed as a declaration in an NgModule. Once those problems are fixed, it works properly.

Thank you for answer. I found my error. Yes, I didnt have @Component in the ProductDetailsComponent! Thank you!

1reaction
dvlascommented, Apr 18, 2020

@dvlas Please, create a simple online reproduction of it on https://stackblitz.com. Thank you.
Please link: https://stackblitz.com/edit/angular-r2zkqd , but I have another error from stackblitz.com. ERROR Error: Uncaught (in promise): Error: No component factory found for ProductDetailsComponent. Did you add it to @NgModule.entryComponents? Error: No component factory found for ProductDetailsComponent. Did you add it to @NgModule.entryComponents? at noComponentFactoryError (https://angular-r2zkqd.stackblitz.io/turbo_modules/@angular/core@9.1.0/bundles/core.umd.js:19840:21) at CodegenComponentFactoryResolver.resolveComponentFactory (https://angular-r2zkqd.stackblitz.io/turbo_modules/@angular/core@9.1.0/bundles/core.umd.js:19887:23) at RouterOutlet.activateWith (https://angular-r2zkqd.stackblitz.io/turbo_modules/@angular/router@9.1.0/bundles/router.umd.js:5320:36) at ActivateRoutes.activateRoutes (https://angular-r2zkqd.stackblitz.io/turbo_modules/@angular/router@9.1.0/bundles/router.umd.js:2519:44) at eval (https://angular-r2zkqd.stackblitz.io/turbo_modules/@angular/router@9.1.0/bundles/router.umd.js:2470:23) at Array.forEach (<anonymous>) at ActivateRoutes.activateChildRoutes (https://angular-r2zkqd.stackblitz.io/turbo_modules/@angular/router@9.1.0/bundles/router.umd.js:2469:33) at ActivateRoutes.activate (https://angular-r2zkqd.stackblitz.io/turbo_modules/@angular/router@9.1.0/bundles/router.umd.js:2394:18) at MapSubscriber.eval [as project] (https://angular-r2zkqd.stackblitz.io/turbo_modules/@angular/router@9.1.0/bundles/router.umd.js:2378:18) at MapSubscriber._next (https://angular-r2zkqd.stackblitz.io/turbo_modules/rxjs@6.5.4/internal/operators/map.js:49:35)

In my local server is not this error.

Error crashed after click link product in app. Thank you guys!

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular routes not working in production - You.com
Routing in my app working perfectly in development mode, but when I serve my dist folder created by ng build --prod they don't...
Read more >
How to trace routing in Angular 2? - Stack Overflow
This helped me to debug a problem with my component's template. I was clicking on a link and nothing was happening, no sign...
Read more >
Move from trial version error | Infragistics Forums
npm ERR! 404 '@infragistics/igniteui-angular@^9.1.1' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use...
Read more >
Angular versioning and releases
The practices described in this document apply to Angular 2.0 and later. If you are currently using AngularJS, ... Patch release, Low risk,...
Read more >
@angular/router | Yarn - Package Manager
angular -logo. Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript and other languages.
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