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.

[bug] [Typescript 3.9] Cannot read property 'paths' of undefined

See original GitHub issue

Current Behavior

Typescript 3.9 add tsconfig.base.json instead ts.config.json

Expected Behavior

Change tsconfig.json to tsconfig.base.json

Steps to Reproduce

  • Run new project
  • Update project to Angular 10.0.1
  • add lib by nx g @nwrl/angular
  • we have an error

Failure Logs

Cannot read property ‘paths’ of undefined

Environment

“dependencies”: { “@nrwl/angular”: “9.4.5”, “@angular/animations”: “^10.0.1”, “@angular/common”: “^10.0.1”, “@angular/compiler”: “^10.0.1”, “@angular/core”: “^10.0.1”, “@angular/forms”: “^10.0.1”, “@angular/platform-browser”: “^10.0.1”, “@angular/platform-browser-dynamic”: “^10.0.1”, “@angular/router”: “^10.0.1”, “core-js”: “^3.6.5”, “rxjs”: “~6.5.5”, “zone.js”: “^0.10.3” }, “devDependencies”: { “@angular/cli”: “10.0.0”, “@nrwl/workspace”: “9.4.5”, “@types/node”: “~14.0.14”, “dotenv”: “8.2.0”, “ts-node”: “~8.10.2”, “tslint”: “~6.1.2”, “eslint”: “7.3.1”, “typescript”: “~3.9.5”, “prettier”: “2.0.5”, “@angular/compiler-cli”: “^10.0.1”, “@angular/language-service”: “^10.0.1”, “@angular-devkit/build-angular”: “0.1000.0”, “codelyzer”: “~5.2.2”, “jest-preset-angular”: “8.2.1”, “@nrwl/jest”: “9.4.5”, “jest”: “26.1.0”, “@types/jest”: “26.0.3”, “ts-jest”: “26.1.1”, “cypress”: “^4.9.0”, “@nrwl/cypress”: “9.4.5” }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:12
  • Comments:27

github_iconTop GitHub Comments

34reactions
emjimadhucommented, Aug 14, 2020

@FrozenPandaz Sorry to reply in this issue after it has been closed. I have found the solution. You were right, i created my workspace like 4 months back, that time the base/root tsconfig file named it as tsconfig.json. And i believe from NX 10, it was renamed to tsconfig.base.json. That was the cause of the problem.

So for anyone having the same issue, rename your root tsconfig.json to tsconfig.base.json and rename all the other tsconfig files which extends from root tsconfig.

Thanks.

17reactions
MaxSassencommented, Jul 2, 2020

just adding the following on the tsconfig.json:
"compilerOptions": { "baseUrl": ".", "rootDir": "." },

worked for me… as a temp solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ng add @nrwl/workspace throws Cannot read property 'paths ...
But I am getting the following error "Cannot read property 'paths' of undefined". I searched a bit in the internet and found out...
Read more >
Documentation - TypeScript 3.9
TypeScript 3.9 Release Notes. ... The fact that sealExhibit contained an undefined somehow poisoned type of lion ... Types of property 'a' are...
Read more >
cannot read properties of undefined (reading 'map') angular
The problem arises because we're attempting to map an undefined object (products) into a JSX element. In our case which is the <Product...
Read more >
ts-loader - npm
Code Splitting and Loading Other Resources; Declarations (.d.ts); Failing the build on TypeScript compilation error; baseUrl / paths module ...
Read more >
Ionic update : Cannot read property 'path' of undefined
Hello, I've a pb when i user commande line ionic update Console send me an error : An error occurred uploading the build:...
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