nx: I'm trying to run nx serve and get: NX Cannot read properties of undefined
Current Behavior
Migration to v13. After that, when running “nx serve <project>” I got: NX Cannot read properties of undefined ('reading endsWith')
Also:
NX As of Nx 13, project configuration should be moved from nx.json to workspace.json/project.json. Please run "nx format" to fix this.
Running “nx format”:
NX Affected criteria defaulted to --base=main --head=HEAD
NX Nx Daemon was not able to compute the project graph.
Log file with the error: /Users/Arturo/aclprojects/acl-customers/node_modules/.cache/nx/d/daemon-error.log
Please file an issue at https://github.com/nrwl/nx
Nx Daemon is going to be disabled until you run "nx reset".
NX As of Nx 13, project configuration should be moved from nx.json to workspace.json/project.json. Please run "nx format" to fix this.
NX Cannot read properties of undefined (reading 'endsWith')`
Expected Behavior
My service running
Steps to Reproduce
nx serve <project> after migration to v13. nx format
Failure Logs
Environment
NX Report complete - copy this into the issue template
Node : 16.13.1
OS : darwin x64
yarn : 1.22.15
nx : 13.8.1
@nrwl/angular : 13.8.1
@nrwl/cli : 13.8.1
@nrwl/cypress : 13.8.1
@nrwl/detox : undefined
@nrwl/devkit : 13.8.1
@nrwl/eslint-plugin-nx : 13.8.1
@nrwl/express : undefined
@nrwl/jest : 13.8.1
@nrwl/js : undefined
@nrwl/linter : 13.8.1
@nrwl/nest : undefined
@nrwl/next : undefined
@nrwl/node : undefined
@nrwl/nx-cloud : undefined
@nrwl/react : undefined
@nrwl/react-native : undefined
@nrwl/schematics : undefined
@nrwl/storybook : 13.8.1
@nrwl/tao : 13.8.1
@nrwl/web : undefined
@nrwl/workspace : 13.8.1
typescript : 4.5.5
rxjs : 7.5.4
---------------------------------------
Community plugins:
@angular/animations: 13.2.2
@angular/cdk: 13.2.2
@angular/common: 13.2.2
@angular/compiler: 13.2.2
@angular/core: 13.2.2
@angular/forms: 13.2.2
@angular/material: 13.2.2
@angular/platform-browser: 13.2.2
@angular/platform-browser-dynamic: 13.2.2
@angular/router: 13.2.2
angular-datatables: 13.0.1
ngx-spinner: 13.1.1
@angular-devkit/build-angular: 13.2.3
@angular/cli: 13.2.3
@angular/compiler-cli: 13.2.2
@angular/language-service: 13.2.2
(node:18220) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/Arturo/aclprojects/acl-customers/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)`
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 15 (1 by maintainers)
Hi @alo,
I hit the same issue migrating from angular & @nrwl v12 to v13. I debugged a little bit and found out that in nx.json, the ‘root’ property for each projects object should be present /as @leosvelperez suggested/
nx.json:
after this, you may need to run the
nx formatcommand I hope this helps. At least it solved my issue.Thanks for reporting this!
I had a look at the stack traces shared by @amakhrov here and the one in the daemon.log file shared by @aclarturocastro. Checking the source code, it looks like you might have a project in your configuration with no value specified for the
rootproperty. That property is required and therefore, it would cause issues when it’s not present.Please make sure that all projects always have a
rootproperty set in the configuration.I’ll close this issue since it seems to be caused by an invalid configuration and in some cases seem to be because the migrations were not run. Please feel free to reopen this if the above doesn’t fix the issue.
I just deleted all the libs in
projectskey onnx.jsonfile and rannx-format. It worked for meSaw this nx.json example
Hope it works for you!
Same here. Migrating to v13, running
nx format, getting the errorhope this answer help someone
@aclarturocastro did you find a way to fix this? I have run into the exact same issue after doing the v13 migration and then running `nx format’
Ok, I got it.
I tried to commit after each step of nx migrate. We also have a pre-commit hook, that runs
nx format:write. This hook fails if I try to commit changes after installing new packages but before running--run-migrationsHey Jason
I provided a couple of weeks ago a private repo… were you able to review it? Arturo Castro
El lun, 14 feb 2022 a la(s) 17:13, Jason Jean @.***) escribió: