Deleting the only app in a workspace makes CLI unusable
See original GitHub issueCurrent Behavior
Deleting all apps in the workspace leaves the CLI unusable. It fails with Project 'testapp' could not be found in workspace
due to the app still being listed in the defaultProject
property in angular.json
Expected Behavior
Deleting the app should not make the CLI fail.
Steps to Reproduce
npx create-nx-workspace@latest
- name:
testtorg
- application:
angular
- app name:
testapp
- styles:
CSS
- cloud:
no
- name:
cd testorg
code .
- open nx Console tab in VSCode
- click Generate
- choose
@nrwl/workspace - remove
- enter projectName
testapp-e2e
and click “Run” (e2e app is deleted) - enter projectName
testapp
and click “Run” (app is deleted)
- enter projectName
- close the Generate tab
- click Generate again
- choose
@nrwl/angular - application
- terminal begins showing
Project 'testapp' could not be found in workspace
errors on all the dry run commands and any command you try to run (e.g. entering a name and clicking “Run” results in the same error - CLI commands give the same error, e.g.
nx g @nrwl/angular:app
->Project 'testapp' could not be found in workspace.
Failure Logs
Environment
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Delete a WorkSpace - AWS Documentation - Amazon.com
Deleting a WorkSpace is a permanent action and cannot be undone. The WorkSpace user's data does not persist and is destroyed. For help...
Read more >Deleting a Workspace - Oracle Help Center
Sign in to Oracle Application Express Administration Services. Click Manage Workspaces. Under Workspace Reports, click Workspaces with Only Sample Application.
Read more >Install and Uninstall | Citrix Workspace app for Windows
Or; Typing the installer file name, installation commands and installation properties using the command-line interface. For information about ...
Read more >Remove apps and custom integrations from your workspace
You can remove them entirely from your workspace, or disable individual authorizations (third-party apps) or configurations (Slack-built apps). Custom ...
Read more >How to remove a TFS Workspace Mapping? - Stack Overflow
TFS Workspaces must contain unique working folder mappings per machine, not just per user and machine. · Try this from the build machine...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@FrozenPandaz I pushed PR #3528
Since
updateWorkspace()
was already being called, I just added the check and warning message there.I also added tests.
👍 I think so as well though I think the user should be warned that they no longer have a
defaultProject
and they may want to define a new one.I think it is ensured that either a
workspace.json
orangular.json
(getWorkspacePath
identifies which one to update) exists in a workspace otherwise, there are errors thrown higher up. Those functions are also used in many other places so if there is an issue, it’s more wide-spread than within@nrwl/workspace:remove
and can be addressed separately.