Skip to content
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

Move library results in module already exists #4600

Closed
yharaskrik opened this issue Jan 23, 2021 · 9 comments
Closed

Move library results in module already exists #4600

yharaskrik opened this issue Jan 23, 2021 · 9 comments

Comments

@yharaskrik
Copy link
Contributor

Current Behavior

With directory structure:

libs/
--builder/
----feature-browser/ <-- This is the library `builder-feature-browser`

When I try and run yarn nx g move --project builder-feature-browser builder/feature/browser (ie. one level deeper) so I have the resulting dir structure

libs/
--builder/
----feature/
------browser/ <-- This is the library `builder-feature-browser`

Does not work. See logs below.

Expected Behavior

Move should work as nothing is conflicting (it is being moved to an entirely different folder)

Steps to Reproduce

https://github.com/yharaskrik/nx-move-project-module-already-exists

Clone and run yarn nx g move --project builder-feature-browser builder/feature/browser

Failure Logs

➜ yarn nx g move --project builder-feature-browser builder/feature/browser
yarn run v1.22.5
$ nx g move --project builder-feature-browser builder/feature/browser
FileAlreadyExistException [Error]: Path "/libs/builder/feature/browser/src/lib/builder-feature-browser.module.ts" already exist.
    at HostTree.create (/Users/jaybell/nx-move-project-module-already-exists/node_modules/@angular-devkit/schematics/src/tree/host-tree.js:270:19)
    at /Users/jaybell/nx-move-project-module-already-exists/node_modules/@nrwl/angular/src/schematics/move/lib/update-module-name.js:57:26
    at Array.forEach (<anonymous>)
    at MapSubscriber.project (/Users/jaybell/nx-move-project-module-already-exists/node_modules/@nrwl/angular/src/schematics/move/lib/update-module-name.js:48:27)
    at MapSubscriber._next (/Users/jaybell/nx-move-project-module-already-exists/node_modules/rxjs/internal/operators/map.js:49:35)
    at MapSubscriber.Subscriber.next (/Users/jaybell/nx-move-project-module-already-exists/node_modules/rxjs/internal/Subscriber.js:66:18)
    at /Users/jaybell/nx-move-project-module-already-exists/node_modules/rxjs/internal/util/subscribeToPromise.js:7:24
Path "/libs/builder/feature/browser/src/lib/builder-feature-browser.module.ts" already exist.

Environment

Node : 12.13.1
  OS   : darwin x64
  npm  : 6.12.1
  
  nx : Not Found
  @nrwl/angular : 11.1.5
  @nrwl/cli : 11.1.5
  @nrwl/cypress : 11.1.5
  @nrwl/devkit : 11.1.5
  @nrwl/eslint-plugin-nx : 11.1.5
  @nrwl/express : Not Found
  @nrwl/jest : 11.1.5
  @nrwl/linter : 11.1.5
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 11.1.5
  @nrwl/web : Not Found
  @nrwl/workspace : 11.1.5
  typescript : 4.0.5
@beeman
Copy link
Contributor

beeman commented Jan 23, 2021

I think this one is loosely related, in the sense that the move generator doesn't properly handle moving to a target that looks similar.

@yharaskrik
Copy link
Contributor Author

That was my assumption as well. if the rootDir starts with the same thing there seems to be some issues.

@beeman
Copy link
Contributor

beeman commented Jan 23, 2021

Indeed. I've been using this to get around it, but it's not ideal.

nx g @nrwl/workspace:move --projectName web-ui-form --destination web-uiform
nx g @nrwl/workspace:move --projectName web-uiform --destination web/ui/form

@yharaskrik
Copy link
Contributor Author

Ya same, usually just tack a 1 onto it or something :P

@vsavkin vsavkin added the scope: misc Misc issues label Jan 27, 2021
@github-actions
Copy link

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@github-actions github-actions bot added the stale label Mar 29, 2021
@beeman
Copy link
Contributor

beeman commented Mar 29, 2021

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

Please don't close this.

@yharaskrik
Copy link
Contributor Author

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

Please don't close this.

^

@github-actions github-actions bot removed the stale label Mar 29, 2021
@leosvelperez
Copy link
Member

@yharaskrik @beeman this was solved in #6507 and it was released in the latest version.

I'm closing this one, if you still think this is an issue, please feel free to reopen it or create a new issue.

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants