nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.22k stars 2.31k forks source link

Target fails with @nx/rollup:rollup executor on NX 19.5.3 #27158

Open paperez opened 1 month ago

paperez commented 1 month ago

Current Behavior

After migrating our application to NX version 19.5.3, we encountered an issue where we are unable to run a target with the @nx/rollup/rollup executor. The same codebase builds successfully when using NX version 17.3.2.

Expected Behavior

The build should succeed as it was doing on Nx 17.3.2.

GitHub Repo

https://github.com/paperez/nx19-workspace

Steps to Reproduce

  1. Install dependencies
  2. Run npm run build:app-1

Nx Report

Node   : 18.19.1
OS     : darwin-arm64
npm    : 10.2.4

nx (global)        : 19.5.0
nx                 : 19.5.3
@nx/js             : 19.5.3
@nx/jest           : 19.5.3
@nx/linter         : 19.5.3
@nx/eslint         : 19.5.3
@nx/workspace      : 19.5.3
@nx/angular        : 19.5.3
@nx/cypress        : 19.5.3
@nx/devkit         : 19.5.3
@nx/eslint-plugin  : 19.5.3
@nx/rollup         : 19.5.3
@nrwl/tao          : 19.5.3
@nx/web            : 19.5.3
@nx/webpack        : 19.5.3
typescript         : 5.5.4
---------------------------------------
Registered Plugins:
@nx/cypress/plugin
@nx/eslint/plugin

Failure Logs

Bundling app-1...
[plugin rpt2] apps/app-1/src/loader.ts:1:29 - error TS6059: File '/Users/pedroperez/dev/nx19-workspace/common/lib1/src/index.ts' is not under 'rootDir' '/Users/pedroperez/dev/nx19-workspace/apps/app-1'. 'rootDir' is expected to contain all source files.
  The file is in the program because:
    Imported via '@nx-19-workspace/common/lib1' from file '/Users/pedroperez/dev/nx19-workspace/apps/app-1/src/loader.ts'
    Root file specified for compilation

1 import { Nx19Library } from '@nx-19-workspace/common/lib1';
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    at getRollupError (/Users/pedroperez/dev/nx19-workspace/node_modules/rollup/dist/shared/parseAst.js:282:41)
    at Object.error (/Users/pedroperez/dev/nx19-workspace/node_modules/rollup/dist/shared/parseAst.js:278:42)
    at Object.error (/Users/pedroperez/dev/nx19-workspace/node_modules/rollup/dist/shared/rollup.js:804:32)
    at RollupContext.error (/Users/pedroperez/dev/nx19-workspace/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:1457:26)
    at /Users/pedroperez/dev/nx19-workspace/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27639:26
    at Array.forEach (<anonymous>)
    at printDiagnostics (/Users/pedroperez/dev/nx19-workspace/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27615:17)
    at typecheckFile (/Users/pedroperez/dev/nx19-workspace/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27972:9)
    at Object.<anonymous> (/Users/pedroperez/dev/nx19-workspace/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:28118:21)
    at Generator.next (<anonymous>)
Bundle failed: app-1

Package Manager Version

No response

Operating System

Additional Information

Working repo https://github.com/paperez/nx17-workspace

WihteCrow commented 3 weeks ago

+1 v19.6.1