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

issue in domain generator when creating an associated application #134

Open
FabienDehopre opened this issue Aug 31, 2023 · 3 comments
Open

Comments

@FabienDehopre
Copy link

FabienDehopre commented Aug 31, 2023

In the latest nx workspace, when you try to create a domain with an associated application (--addApp=true), the generator fail with the following error message: "Cannot read properties of undefined (reading 'replace')".
In fact, the issue comes from the fact that the generator tries to get the workspace npm scope from the nx.json file (using the readWorkspaceConfiguration function).
Unfortunately, the npmScope property on the nx.json file is now deprecated (see official doc: https://nx.dev/packages/devkit/documents/Workspace#npmscope) and is not added to the nx.json file in new workspace.
To get the workspace npm scope, you need to use the getNpmScope function instead.

@L-X-T
Copy link
Collaborator

L-X-T commented Sep 26, 2023

Thank you for the report @FabienDehopre, I've encountered a similar problem which is also due to the reading of the npmScope. I'll inform @manfredsteyer.

@scsete
Copy link

scsete commented Oct 23, 2024

@L-X-T :I have the same issue with or without project addition during execution. I'm using pnpm.


Angular: 18.2.0
Nx: 20.0.2
@angular-architects/ddd:19.0.1

`➜ frontends git:(feature/ITU-5-FE-Poc) ✗ nx g @angular-architects/ddd:domain --name=dashboard --directory=lib --verbose

NX Generating @angular-architects/ddd:domain

✔ Would you like to add an associated application? (y/N) · true

NX Cannot read properties of undefined (reading 'replace')

TypeError: Cannot read properties of undefined (reading 'replace')
at removeWindowsDriveLetter (/Users/xxx/node_modules/.pnpm/nx@20.0.2_@swc-node+register@1.9.2_@swc+core@1.5.29_@swc+helpers@0.5.13__@swc[email protected]_ty_7tbae4hpjjuxpyy2rwgajkg5ge/node_modules/nx/src/utils/path.js:9:27)
at normalizePath (/Users/xxx/node_modules/.pnpm/nx@20.0.2_@swc-node+register@1.9.2_@swc+core@1.5.29_@swc+helpers@0.5.13__@swc[email protected]_ty_7tbae4hpjjuxpyy2rwgajkg5ge/node_modules/nx/src/utils/path.js:16:12)
at determineProjectNameAndRootOptions (/Users/xxx/node_modules/.pnpm/@nx[email protected]_nx@20.0.2_@swc-node+register@1.9.2_@swc+core@1.5.29_@swc+helpers@0.5.13__@s_nhdvhkpuyueyd5oub2ncp4g37i/node_modules/@nx/devkit/src/generators/project-name-and-root-utils.js:10:58)
at normalizeOptions (/Users/xxx/node_modules/.pnpm/@[email protected]_txy3i4udpobywqxqkkhoq7ybaq/node_modules/@nx/angular/src/generators/library/lib/normalize-options.js:26:151)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async libraryGenerator (/Users/xxx/node_modules/.pnpm/@[email protected]_txy3i4udpobywqxqkkhoq7ybaq/node_modules/@nx/angular/src/generators/library/library.js:38:21)
`


There was no activity in this thread.
Any advice how to proceed?

@scsete scsete mentioned this issue Oct 23, 2024
@L-X-T
Copy link
Collaborator

L-X-T commented Oct 23, 2024

@scsete no, I'm very sorry: currently no advice. I'll ask @manfredsteyer once more. I know he's been rather busy recently.

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

No branches or pull requests

3 participants