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
[BUG] Generating webapi does not seem to work in new nx workspace #838
Comments
Current workaround.
|
I'm also having the same issue, but I can't replicate the solution from @rudfoss. |
This is a duplicate of #828 EDIT: Despite having similar outcomes, it's not in fact a duplicate. The other issue is around the dryrun flag. This issue is related to not creating the project.json file when Nx Crystal is enabled for App projects, but webapi projects attempt to create a swagger project which is expecting the project.json file |
To be more explicit here, this line https://vscode.dev/github/nx-dotnet/nx-dotnet/blob/master/packages/core/src/generators/add-swagger-target/add-swagger-target.ts#L29 is attempting to retrieve the project configuration using this function from the core nx project https://vscode.dev/github/nrwl/nx/blob/master/packages/nx/src/generators/utils/project-configuration.ts#L187 which explicitly uses file patterns to look for the project.json file. The project.json file is not being created, however, by default in nx 18+ https://vscode.dev/github/nx-dotnet/nx-dotnet/blob/master/packages/core/src/generators/utils/generate-project.ts#L192 |
Hi, yea this should be fixed. I'll try to make some time this week to get something put together. |
Thanks for the updates and the quick fix guys! It is greatly appreciated. |
Current Behavior
Running the base generator for an application fails with error:
Cannot find configuration for '[app-name]-[app-name]'
(app name is repeated when parameter--directory
is specified)Expected Behavior
Generator should generate webapi as expected.
Github Repo
No response
Steps to Reproduce
@nx-dotnet/core
and initializepnpm add -D @nx-dotnet/core pnpm exec nx g @nx-dotnet/core:init
Generator fails with
Cannot find configuration for [app-name]
:Nx Report
nx.json
Failure Logs
No response
Additional Information
The text was updated successfully, but these errors were encountered: