Closed
Description
Current Behavior
@nrwl/workspace:move
generator fails while trying to move around a lib in a newly created (via angular cli) project, since from the start tsconfig.json
has comments inside (I guess it affects all newcomers trying to use nx in their projects).
Expected Behavior
npx nx generate @nrwl/workspace:move libs --project-name=some-lib --verbose
should work with tsconfig.json
which uses json5
file format (comments).
Github Repo
No response
Steps to Reproduce
ng new ng14-minimal --minimal --inline-style --inline-template --skip-tests --routing false --style=css
cd ng14-minimal
ng g library some-lib
cat tsconfig.json
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
npm i @nrwl/workspace -D
npx nx generate @nrwl/workspace:move libs --project-name=some-lib --verbose
Nx Report
> NX Report complete - copy this into the issue template
Node : 14.20.0
OS : win32 x64
npm : 6.14.17
nx : 15.3.0
@nrwl/angular : Not Found
@nrwl/cypress : Not Found
@nrwl/detox : Not Found
@nrwl/devkit : 15.3.0
@nrwl/esbuild : Not Found
@nrwl/eslint-plugin-nx : Not Found
@nrwl/expo : Not Found
@nrwl/express : Not Found
@nrwl/jest : Not Found
@nrwl/js : Not Found
@nrwl/linter : 15.3.0
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/rollup : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : Not Found
@nrwl/web : Not Found
@nrwl/webpack : Not Found
@nrwl/workspace : 15.3.0
typescript : 4.7.4
---------------------------------------
Local workspace plugins:
---------------------------------------
Community plugins:
Failure Logs
npx nx generate @nrwl/workspace:move libs --project-name=some-lib --verbose
> NX Generating @nrwl/workspace:move
> NX Unexpected token / in JSON at position 0
SyntaxError: Unexpected token / in JSON at position 0
at JSON.parse (<anonymous>)
at updateImports (C:\temp\ng14-minimal\node_modules\@nrwl\workspace\src\generators\move\lib\update-imports.js:29:25)
at C:\temp\ng14-minimal\node_modules\@nrwl\workspace\src\generators\move\move.js:28:44
at Generator.next (<anonymous>)
at C:\temp\ng14-minimal\node_modules\tslib\tslib.js:118:75
at new Promise (<anonymous>)
at Object.__awaiter (C:\temp\ng14-minimal\node_modules\tslib\tslib.js:114:16)
at moveGenerator (C:\temp\ng14-minimal\node_modules\@nrwl\workspace\src\generators\move\move.js:22:20)
at Object.<anonymous> (C:\temp\ng14-minimal\node_modules\nx\src\command-line\generate.js:222:36)
at Generator.next (<anonymous>)
Additional Information
No response
Activity
Coly010 commentedon Dec 14, 2022
There's a specific move generator for Angular workspaces
nx g @nrwl/angular:move
Can you try that instead? https://nx.dev/packages/angular/generators/move
Den-dp commentedon Dec 15, 2022
@Coly010 unfortunately I see the same error
looks like internally it uses
@nrwl/workspace:move
anywaynx/packages/angular/src/generators/move/move.ts
Lines 1 to 25 in c3c9b2d
Coly010 commentedon Dec 15, 2022
It does, but it does extra things required for angular, let me take a look
fix(core): move generator should work if there are comments in tsconfig
fix(core): move generator should work if there are comments in tsconfig
fix(core): move generator should work if there are comments in tsconfig
fix(core): move generator should work if there are comments in tsconfig
fix(core): move generator should work if there are comments in tsconfig
github-actions commentedon Mar 21, 2023
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.
2 remaining items