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.

Migration from 14.8.1 to 14.8.2 makes our libs unbuildable with "is not under 'rootDir'" errors

See original GitHub issue

Current Behavior

After migration from 14.8.1 to 14.8.2, libraries that import from other libraries start showing errors like this:

Compiling TypeScript files for project "common"...
libs/common/src/lib/Resco/bindingList/asyncBindingList.ts:1:20 - error TS6059: File '/home/kolik/Workspaces/resco2/web-projects-nx/libs/logger/src/index.ts' is not under 'rootDir' 'libs/common'. 'rootDir' is expected to contain all source files.

1 import logger from "@resconet/logger";
                     ~~~~~~~~~~~~~~~~~~
libs/logger/src/index.ts:1:34 - error TS6059: File '/home/kolik/Workspaces/resco2/web-projects-nx/libs/logger/src/lib/customExLog.ts' is not under 'rootDir' 'libs/common'. 'rootDir' is expected to contain all source files.
  The file is in the program because:
    Imported via "./lib/customExLog" from file '/home/kolik/Workspaces/resco2/web-projects-nx/libs/logger/src/index.ts'
    Imported via "./customExLog" from file '/home/kolik/Workspaces/resco2/web-projects-nx/libs/logger/src/lib/loggerCore.ts'

After reverting to 14.8.1, the lib builds OK.

Expected Behavior

To build without errors.

Environment

   NX   Report complete - copy this into the issue template

   Node : 16.17.1
   OS   : linux x64
   npm  : 8.16.0
   
   nx : 14.8.2
   @nrwl/angular : Not Found
   @nrwl/cypress : 14.8.2
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.8.2
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 14.8.2
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 14.8.2
   @nrwl/js : 14.8.2
   @nrwl/linter : 14.8.2
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 14.8.2
   @nrwl/react-native : Not Found
   @nrwl/rollup : 14.8.2
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.8.2
   @nrwl/web : 14.8.2
   @nrwl/webpack : 14.8.2
   @nrwl/workspace : 14.8.2
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
AgentEndercommented, Oct 4, 2022

Can you check in 14.8.3? I think this may be resolved.

2reactions
mgrejanincommented, Sep 30, 2022

Same issue here. It works locally but not in CircleCi.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Project graph is broken in 14.8.2 on environments with older ...
Migration from 14.8.1 to 14.8.2 makes our libs unbuildable with "is not under 'rootDir'" errors #12346. Closed.
Read more >
error TS6059: File is not under 'rootDir' .. 'rootDir' is expected ...
What is rootDir ? rootDir is set to a root folder, that contains all your source files. If not specified, TS will automatically...
Read more >
Migration from 14.8.1 to 14.8.2 makes our libs unbuildable with "is ...
Migration from 14.8.1 to 14.8.2 makes our libs unbuildable with "is not under 'rootDir '" errors.
Read more >
Angular,monorepo,multiple libs and rootDir issue | by Arun Malik
On running “ng build lib1” All we got is this… error TS6059: File '/Users/admin/Desktop/App/libs/lib2/src/util.ts' is not under 'rootDir ...
Read more >
Link warning after converting project to Xcode 7
After letting Xcode convert a simple Swift project to Xcode 7, and fixing the various Swift "inspired" build errors, I'm still seeing a...
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