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.

nx commands are no longer working with non solution tsconfig file

See original GitHub issue

Current Behavior

If you do not have a solution tsconfig file (tsconfig.base.json), nx affected commands fail (and possible others)

Expected Behavior

It should work with non solution config files, i.e. with tsconfig.json file only.

Steps to Reproduce

$ npx create-nx-workspace test-workspace
$ cd test-workspace
$ npx nx affected --target=lint

All works as expected. Rename tsconfig.base.json to tsconfig.json.

$ npx nx affected --target=lint

This will error out.

Failure Logs

Error: ENOENT: no such file or directory, open 'C:\..\.././tsconfig.base.json'
    at Object.openSync (fs.js:448:3)
    at Object.readFileSync (fs.js:350:35)
    at TargetProjectLocator.defaultFileRead [as fileRead] (C:\..\..\node_modules\@nrwl\workspace\src\core\file-utils.js:150:17)
    at new TargetProjectLocator (C:\..\..\node_modules\@nrwl\workspace\src\core\target-project-locator.js:15:73)
    at buildExplicitTypeScriptDependencies (C:\..\..\node_modules\@nrwl\workspace\src\core\project-graph\build-dependencies\explicit-project-dependencies.js:8:34)
    at C:\..\..\node_modules\@nrwl\workspace\src\core\project-graph\project-graph.js:61:41
    at Array.forEach (<anonymous>)
    at buildProjectGraph (C:\..\..\node_modules\@nrwl\workspace\src\core\project-graph\project-graph.js:61:26)
    at Object.createProjectGraph (C:\..\..\node_modules\@nrwl\workspace\src\core\project-graph\project-graph.js:40:30)
    at Object.<anonymous> (C:\..\..\node_modules\@nrwl\workspace\src\command-line\affected.js:23:46) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'C:\\..\\..\\temp/./tsconfig.base.json'
}

Environment

 nx : Not Found
  @nrwl/angular : Not Found
  @nrwl/cli : 10.2.0
  @nrwl/cypress : Not Found
  @nrwl/eslint-plugin-nx : Not Found
  @nrwl/express : Not Found
  @nrwl/jest : Not Found
  @nrwl/linter : Not Found
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 10.2.0
  @nrwl/web : Not Found
  @nrwl/workspace : 10.2.0
  typescript : 3.9.7

Additional Information

I believe the issue was introduced here.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
cjanzcommented, Oct 6, 2020

I have opened a new issue #3874 for the problems.

1reaction
cjanzcommented, Oct 6, 2020

@vincentpalita @FrozenPandaz I have just tested the new Nx release 10.3.0 with the latest Angular CLI version (10.1.4) again.

In my case ng add @nrwl/workspace now completes without any errors (see #3770) 🥳. But the ng-add schematic doesn’t create a root-level tsconfig.base.json file although this file is referenced in the apps/<appname>/tsconfig.app.json file. This leads to several errors, i.e. the app cannot be started.

Also running another Nx schematic (e.g. ng generate @nrwl/angular:library --name=test) exits with Cannot read property 'paths' of undefined.

I will open a new issue for this problem so that I can provide further information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nrwl-nx/community - Gitter
Failed to load tsconfig.json: Missing baseUrl in compilerOptions Starting ... However, running this command outside this project does not produce any error.
Read more >
node.js - tsc is not recognized as internal or external command
In the VSCode file tasks.json , the "command": "tsc" will try to find the tsc windows command script in some folder that it...
Read more >
JavaScript and TypeScript - Nx
JavaScript and TypeScript. Nx is a general-purpose build system and a general-purpose CLI. It works with JavaScript, TypeScript, Java, C#, Go, etc.
Read more >
Documentation - Project References - TypeScript
You could use multiple tsconfig files to solve some of those problems, ... There's no built-in up-to-date checking, so you end up always...
Read more >
Adding Nx to an Existing Monorepo by Running One Command
Add Nx to your package.json · Create workspace.json and nx.json listing all the projects in the workspace · Set up a tsconfig file...
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