-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nest Library generation fails in v20.0.0 #28404
Comments
I am getting the below error while setting up nest project.
|
This is related to #28322 |
Hey, thanks for reporting an issue. To paraphrase from the above
|
I've run into the same issue as Johnny. It seems like this only impacts the generator, so you could build the Library by hand and things would still work, correct? Is there a good example of that floating around somewhere using NX20 and Angular? At least as a workaround until the generator gets fixed? |
I also faced the same issue of @coreConvention. I got a work around for this by creating a file named eslint.config.js in the working directory. But still not sure if this is the right solution. Looking for the right fix for this "@nx/angular": "20.1.0", |
Same here, Error: Could not find root flat config file
at getRootESLintFlatConfigFilename (/home/kasir/projects/nestjs-materials/typeorm/node_modules/.pnpm/@nx+eslint@20.2.1_@babel+traverse@7.26.4_@swc-node+register@1.10.9_@swc+core@1.10.1_@swc+help_p7jqooqyk4oi6p3v7733sbzc7e/node_modules/@nx/eslint/src/utils/flat-config.js:18:11)
at lintConfigHasOverride (/home/kasir/projects/nestjs-materials/typeorm/node_modules/.pnpm/@nx+eslint@20.2.1_@babel+traverse@7.26.4_@swc-node+register@1.10.9_@swc+core@1.10.1_@swc+help_p7jqooqyk4oi6p3v7733sbzc7e/node_modules/@nx/eslint/src/generators/utils/eslint-file.js:179:164)
at addLint (/home/kasir/projects/nestjs-materials/typeorm/node_modules/.pnpm/@nx+js@20.2.1_@babel+traverse@7.26.4_@swc-node+register@1.10.9_@swc+core@1.10.1_@swc+helpers@_hy7mt26ijjtzogm4skpywoo75e/node_modules/@nx/js/src/generators/library/library.js:292:9)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async libraryGeneratorInternal (/home/kasir/projects/nestjs-materials/typeorm/node_modules/.pnpm/@nx+js@20.2.1_@babel+traverse@7.26.4_@swc-node+register@1.10.9_@swc+core@1.10.1_@swc+helpers@_hy7mt26ijjtzogm4skpywoo75e/node_modules/@nx/js/src/generators/library/library.js:81:30)
at async /home/kasir/projects/nestjs-materials/typeorm/node_modules/.pnpm/nx@20.2.1_@swc-node+register@1.10.9_@swc+core@1.10.1_@swc+helpers@0.5.15__@swc+types@0.1.17_t_w6pixw4aadyn6222jr5o5yzwvy/node_modules/nx/src/command-line/generate/generate.js:240:26
at async handleErrors (/home/kasir/projects/nestjs-materials/typeorm/node_modules/.pnpm/nx@20.2.1_@swc-node+register@1.10.9_@swc+core@1.10.1_@swc+helpers@0.5.15__@swc+types@0.1.17_t_w6pixw4aadyn6222jr5o5yzwvy/node_modules/nx/src/utils/handle-errors.js:8:24)
at async Object.handler (/home/kasir/projects/nestjs-materials/typeorm/node_modules/.pnpm/nx@20.2.1_@swc-node+register@1.10.9_@swc+core@1.10.1_@swc+helpers@0.5.15__@swc+types@0.1.17_t_w6pixw4aadyn6222jr5o5yzwvy/node_modules/nx/src/command-line/generate/command-object.js:13:22) I am using Nx + PNPM + NestJS. I wanted to create a new library but instead I created a new bug. BTW I am not sure if this is somehow also related to this issue I opened here: #28991 WorkaroundI renamed my root |
That worked for me too... Very strange |
We can't just rename json to js. But this helped me: https://nx.dev/recipes/tips-n-tricks/flat-config It does the "renaming :) |
@bdahl1 It is happening because some code in Nx expects to find nx/packages/eslint/src/utils/flat-config.ts Lines 5 to 17 in 0d1c960
|
Current Behavior
nx g @nx/nest:lib fgb-tenant
NX Generating @nx/nest:library
NX Could not find root flat config file
Expected Behavior
Library is generated
GitHub Repo
No response
Steps to Reproduce
Nx Report
Node : 20.11.1
OS : win32-x64
Native Target : x86_64-windows
npm : 9.6.6
nx (global) : 20.0.0
nx : 20.0.0
@nx/js : 20.0.0
@nx/jest : 20.0.0
@nx/eslint : 20.0.0
@nx/workspace : 20.0.0
@nx/angular : 20.0.0
@nx/cypress : 20.0.0
@nx/devkit : 20.0.0
@nx/esbuild : 20.0.0
@nx/eslint-plugin : 20.0.0
@nx/express : 20.0.0
@nx/nest : 20.0.0
@nx/node : 20.0.0
@nx/web : 20.0.0
@nx/webpack : 20.0.0
typescript : 5.5.4
Community plugins:
@ngrx/component-store : 18.1.0
@ngrx/effects : 18.1.0
@ngrx/entity : 18.1.0
@ngrx/eslint-plugin : 18.1.0
@ngrx/operators : 18.1.0
@ngrx/router-store : 18.1.0
@ngrx/schematics : 18.1.0
@ngrx/store : 18.1.0
@ngrx/store-devtools : 18.1.0
Failure Logs
NX Generating @nx/nest:library
NX Could not find root flat config file
Package Manager Version
No response
Operating System
Additional Information
I have tried it with the directory command,
nx g lib
, and the fully expanded command. Nothing works.The text was updated successfully, but these errors were encountered: