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.

Cannot read property 'NoopAnalytics' of undefined

See original GitHub issue

🐞 Bug report

Command (mark with an x)

- [x] new
- [x] build
- [x] serve
- [x] test
- [x] e2e
- [x] generate
- [x] add
- [x] update
- [x] lint
- [x] xi18n
- [x] run
- [x] config
- [x] help
- [x] version
- [x] doc

Is this a regression?

Yes, ng command stop working

Description

on run ng i’ve got:

Cannot read property 'NoopAnalytics' of undefined
TypeError: Cannot read property 'NoopAnalytics' of undefined
    at new Command (*/node_modules/@angular/cli/models/command.js:21:68)
    at new ArchitectCommand (*/node_modules/@angular/cli/models/architect-command.js:22:9)
    at new RunCommand (*/node_modules/@angular/cli/commands/run-impl.js:11:1)
    at Object.runCommand (*/node_modules/@angular/cli/models/command-runner.js:172:25)
    at async default_1 (*/node_modules/@angular/cli/lib/cli/index.js:32:31)

πŸ”¬ Minimal Reproduction

updated from 7 to 8

πŸ”₯ Exception or Error

Cannot read property 'NoopAnalytics' of undefined
TypeError: Cannot read property 'NoopAnalytics' of undefined
    at new Command (*/node_modules/@angular/cli/models/command.js:21:68)
    at new ArchitectCommand (*/node_modules/@angular/cli/models/architect-command.js:22:9)
    at new RunCommand (*/node_modules/@angular/cli/commands/run-impl.js:11:1)
    at Object.runCommand (*/node_modules/@angular/cli/models/command-runner.js:172:25)
    at async default_1 (*/node_modules/@angular/cli/lib/cli/index.js:32:31)



🌍 Your Environment

I can't ng don't work :), so here is my package.json:


  "dependencies": {
    "@nrwl/angular": "8.0.0",
    "@angular/animations": "^8.0.0",
    "@angular/common": "^8.0.0",
    "@angular/compiler": "^8.0.0",
    "@angular/core": "^8.0.0",
    "@angular/forms": "^8.0.0",
    "@angular/platform-browser": "^8.0.0",
    "@angular/platform-browser-dynamic": "^8.0.0",
    "@angular/router": "^8.0.0",
    "@angularclass/hmr": "^2.1.3",
    "@betadigitalproduction/ngx-platform-service": "^1.0.7",
    "@ngqp/core": "^1.0.0",
    "@ngrx/effects": "^7.4.0",
    "@ngrx/entity": "^7.4.0",
    "@ngrx/router-store": "^7.4.0",
    "@ngrx/schematics": "^7.4.0",
    "@ngrx/store": "^7.4.0",
    "@ngrx/store-devtools": "^7.4.0",
    "@ngx-pwa/local-storage": "8.0.0",
    "@ngx-translate/core": "11.0.1",
    "@sentry/browser": "5.3.0",
    "core-js": "^3.1.3",
    "date-fns": "^2.0.0-alpha.27",
    "localize-router": "2.0.0-RC.2",
    "ng-svg-icon-sprite": "1.6.0",
    "ng-zorro-antd": "^7.4.1",
    "ngx-build-plus": "8.0.0-rc.3.0.1",
    "nprogress": "^0.2.0",
    "rxjs": "6.5.2",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@nrwl/workspace": "8.0.0",
    "@nrwl/jest": "8.0.0",
    "@nrwl/cypress": "8.0.0",
    "@angular-devkit/build-angular": "~0.800.1",
    "@angular-devkit/build-ng-packagr": "~0.800.1",
    "@angular/cli": "8.0.1",
    "@angular/compiler-cli": "~8.0.0",
    "@angular/language-service": "^8.0.0",
    "@betalabs/ngx-observable-input": "^0.1.8",
    "@betalabs/ngx-take-until-destroy": "^0.1.9",
    "@biesbjerg/ngx-translate-extract": "2.3.4",
    "@ngrx/store-devtools": "7.4.0",
    "@types/jest": "24.0.13",
    "@types/jquery": "3.3.29",
    "@types/node": "~12.0.4",
    "@types/webpack": "^4.4.31",
    "codelyzer": "^5.0.1",
    "conventional-changelog-cli": "2.0.21",
    "cypress": "3.3.1",
    "cz-conventional-changelog": "2.1.0",
    "dotenv": "8.0.0",
    "jest": "24.8.0",
    "jest-preset-angular": "7.1.1",
    "junit": "^1.4.9",
    "mocha-junit-reporter": "^1.22.0",
    "ng-packagr": "^5.2.0",
    "ngrx-store-freeze": "0.2.4",
    "prettier": "1.17.1",
    "svg-sprite-generator": "0.0.7",
    "ts-jest": "24.0.2",
    "ts-node": "~8.2.0",
    "tsickle": ">=0.34.0",
    "tslib": "^1.9.0",
    "tslint": "~5.17.0",
    "typescript": "3.5.1"
  }

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
juristrcommented, Jun 2, 2019

πŸ€” I just got the same error, happening here. Looks like as if the imported analytics object is not defined which is really strange. When I generate a new v7 project and upgrade, the error doesn’t happen. Happens when I upgrade my nrwl/nx based project. Maybe NX changes that part of the upgrade process? @FrozenPandaz any insights here?

I have these devkit dependencies

"@angular-devkit/build-angular": "~0.13.1",
"@angular-devkit/build-ng-packagr": "^0.12.0",
"@angular-devkit/schematics": "^7.1.4",
"@angular/cli": "^7.3.7",
"@angular/compiler-cli": "^7.1.1",

// update
The error also happens when I start the app (after the failed upgrade, which looks like it completed). Removed @angular-devkit/schematics and the error disappears, getting #14557 now πŸ˜…. I’ll give it a closer look the next days

3reactions
YoeriNijscommented, Jun 17, 2019

For us, it helped to remove the local node_modules prior to npm install.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular cli build prod: TypeError: Cannot read property 'kind ...
This does let me run my project build, however I'm still getting a "TypeError: Cannot read property 'kind' of undefined" message when buildingΒ ......
Read more >
TypeError: Cannot read property 'default' of undefined - Radzen
So whenever I try to run I am running into this error: ng-cli: Γ— ο½’wdmο½£: TypeError: Cannot read property 'default' of undefined
Read more >
cannot read property 'kind' of undefined angular 8
cannot read property 'kind' of undefined graphql. ** type keyword use for return response data. GraphQL Cannot read property 'query' of undefined. 2....
Read more >
nx cannot read properties of undefined (reading 'endswith')
I have nx 14.4.3 version in my system. And when I run nx serve it gives me the error :- TypeError: Cannot read...
Read more >
Toolips ng build –prod error - MDBootstrap
p>when I was trying to build production of my project we got this error:</p> <p>in Error: TypeError: Cannot read property 'kind' of undefined<br...
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