question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deleting the only app in a workspace makes CLI unusable

See original GitHub issue

Current 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
  • 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)
  • 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jdforsythecommented, Aug 14, 2020

@FrozenPandaz I pushed PR #3528

Since updateWorkspace() was already being called, I just added the check and warning message there.

I also added tests.

0reactions
FrozenPandazcommented, Aug 14, 2020

Removing it is fine.

👍 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.

If a user removes an app and has no angular.json file, one shouldn’t be created.

I think it is ensured that either a workspace.json or angular.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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found