You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm working on updating an existing Nx app to leverage built projects in our webpack build with the buildLibsFromSource option. This app uses Nx webpack plugins (withNx, withReact) and the @nx/webpack executor.
I ran into the following error when running the serve target:
RangeError: Maximum call stack size exceeded
at new FastBuffer (node:internal/buffer:960:14)
at allocate (node:buffer:457:15)
at Function.allocUnsafe (node:buffer:427:10)
at tryCreateBuffer (node:fs:439:21)
at Object.readFileSync (node:fs:482:14)
at readFileSync (/Users/zgonzales/repro-dev-server-error/node_modules/tsconfig-paths/lib/tsconfig-loader.js:85:19)
at loadTsconfig (/Users/zgonzales/repro-dev-server-error/node_modules/tsconfig-paths/lib/tsconfig-loader.js:90:24)
at loadTsconfigFromExtends (/Users/zgonzales/repro-dev-server-error/node_modules/tsconfig-paths/lib/tsconfig-loader.js:134:18)
at loadTsconfig (/Users/zgonzales/repro-dev-server-error/node_modules/tsconfig-paths/lib/tsconfig-loader.js:108:20)
at loadTsconfigFromExtends (/Users/zgonzales/repro-dev-server-error/node_modules/tsconfig-paths/lib/tsconfig-loader.js:134:18)
I found that putting a breakpoint at node_modules/@nx/js/src/utils/buildable-libs-utils.js:119, there looks to be some unexpected behavior with the extends property of the temp tsconfig.generated.json file.
The first time the breakpoint is hit, extends field points to apps/repro-dev-server-error-app/tsconfig.app.json (I believe this is expected):
The second time the breakpoint is hit, extends points to tsconfig.generated.json:
The options that are used in this second call can be traced back to the options coming from withNx:
This is only an issue with dev server. Running a static build of webpack is successful.
Expected Behavior
The Webpack build succeeds when using Nx webpack plugins and setting buildLibsFromSource to false. In addition to using withNx and withReact, we've create custom plugins in our webpack config that follow this pattern. It would be great if we didn't have to refactor our config to use the basic plugins in order to disable buildLibsFromSource.
Current Behavior
Hello, I'm working on updating an existing Nx app to leverage built projects in our webpack build with the
buildLibsFromSource
option. This app uses Nx webpack plugins (withNx, withReact) and the @nx/webpack executor.I ran into the following error when running the serve target:
I found that putting a breakpoint at
node_modules/@nx/js/src/utils/buildable-libs-utils.js:119
, there looks to be some unexpected behavior with the extends property of the temptsconfig.generated.json
file.The first time the breakpoint is hit, extends field points to
apps/repro-dev-server-error-app/tsconfig.app.json
(I believe this is expected):The second time the breakpoint is hit, extends points to
tsconfig.generated.json
:The options that are used in this second call can be traced back to the options coming from
withNx
:nx/packages/webpack/src/utils/with-nx.ts
Line 20 in 999abe9
This is only an issue with dev server. Running a static build of webpack is successful.
Expected Behavior
The Webpack build succeeds when using Nx webpack plugins and setting
buildLibsFromSource
to false. In addition to using withNx and withReact, we've create custom plugins in our webpack config that follow this pattern. It would be great if we didn't have to refactor our config to use the basic plugins in order to disablebuildLibsFromSource
.When the webpack config is changed to use the basic plugins as outlined on this page: https://nx.dev/recipes/webpack/webpack-config-setup, the error goes away.
The error also goes away when the webpack config is unchanged, but
buildLibsFromSource
is set to true.GitHub Repo
https://github.com/zoe-gonzales/repro-dev-server-error/tree/main
Steps to Reproduce
npx nx serve repro-dev-server-error-app --verbose
. TheMaximum call stack size exceeded error
should throw.Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: