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

Convert to monorepo fails automatically. Manually also fails #23058

Open
1 of 4 tasks
roldengarm opened this issue Apr 29, 2024 · 2 comments
Open
1 of 4 tasks

Convert to monorepo fails automatically. Manually also fails #23058

roldengarm opened this issue Apr 29, 2024 · 2 comments
Assignees
Labels

Comments

@roldengarm
Copy link

Current Behavior

I'm trying to convert from a standalone repo to a mono repo using this documentation, but it's failing both using the nx command as well as the manual steps.

Expected Behavior

I can successfully convert to a mono repo

GitHub Repo

No response

Steps to Reproduce

  1. Run nx g convert-to-monorepo

OR

  1. Delete tsconfig.json
  2. Run nx g app temp

Nx Report

NX   Report complete - copy this into the issue template

Node   : 18.19.1
OS     : win32-x64
npm    : 10.2.4

nx (global)        : 18.3.4
nx                 : 18.3.4
@nx/js             : 18.3.4
@nx/jest           : 18.3.4
@nx/linter         : 18.3.4
@nx/eslint         : 18.3.4
@nx/workspace      : 18.3.4
@nx/angular        : 18.3.4
@nx/cypress        : 18.3.4
@nx/devkit         : 18.3.4
@nx/eslint-plugin  : 18.3.4
@nx/storybook      : 18.3.4
@nrwl/tao          : 18.3.4
@nx/web            : 18.3.4
@nx/webpack        : 18.3.4
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/jest/plugin
@nx/cypress/plugin
@nx/storybook/plugin
---------------------------------------
Community plugins:
@fortawesome/angular-fontawesome : 0.14.1
@ng-bootstrap/ng-bootstrap       : 16.0.0
@storybook/angular               : 7.6.17
apollo-angular                   : 6.0.0
ngx-toastr                       : 18.0.0

Failure Logs

nx g convert-to-monorepo --verbose

 NX  Generating @nx/workspace:convert-to-monorepo


 NX   The following projects are defined in multiple locations:

- PROJECT_NAME:
  - .
  - apps/PROJECT_NAME

To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.

ProjectsWithConflictingNamesError: The following projects are defined in multiple locations:
- PROJECT_NAME:
  - .
  - apps/PROJECT_NAME

---
And manual approach:

$ nx g app temp
Convert compiler options from json failed, Cannot read file 'D:/projects/PROJECT_NAME/tsconfig.json'.
Convert compiler options from json failed, Cannot read file 'D:/projects/PROJECT_NAME/tsconfig.json'.

 NX   Failed to process project graph.

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@AgentEnder
Copy link
Member

The error message is telling you that the package.json or project.json at the root has a name set that conflicts with the package.json or project.json in the individual project's root.

You can fix the error by updating either name.

Can you create a reproduction for us the better diagnose the root cause of this?

@AgentEnder AgentEnder added the scope: misc Misc issues label Apr 29, 2024
@AgentEnder AgentEnder self-assigned this Apr 29, 2024
@roldengarm
Copy link
Author

@AgentEnder thanks for the prompt reply!
It was indeed the name in package.json
I had not changed it since the initial generation, so I guess if you would create a standalone repo with default values and then run nx g convert-to-monorepo it will cause the same error.

Didn't know nx would also look there for project information.

I could run it, but ran into a couple of things I had to fix manually:

  • /tsconfig.json and /.eslintrc.json were missing => copied manually from another project
  • .eslintrc.base.json referred itself, causing call stack exceeded
  • Had to manually fix Tailwind & Storybook

Not major, the generator definitely helped. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants