Cannot read properties of undefined (reading 'endsWith') local plugin
See original GitHub issueCurrent Behavior
When I generate a local plugin and attempt to run it (or any Nx command), I get this error message
Cannot read properties of undefined (reading ‘endsWith’)
Expected Behavior
Nx commands should run and the local plugin should work as expected.
Steps to Reproduce
- Clone this github repo: https://github.com/AndrewOttavianoAbb/nx-plugin-test
- Run any Nx command:
nx build test-lib
- Observe the error in the terminal
To create this repo, I generated it using version 13 (since we have a dependency on React 17 right now), generated a library, and then generated a plugin. I encountered the error after running an Nx command. This is an example repo of a bigger one that we created a while ago where I was trying to add a generator and ran into the same issue.
Failure Logs
NX Cannot read properties of undefined (reading ‘endsWith’)
Environment
Node : 16.15.0
OS : win32 x64
npm : 8.0.0
nx : 13.10.6
@nrwl/angular : Not Found
@nrwl/cypress : Not Found
@nrwl/detox : Not Found
@nrwl/devkit : 14.4.3
@nrwl/eslint-plugin-nx : 13.10.6
@nrwl/express : Not Found
@nrwl/jest : 13.10.6
@nrwl/js : 13.10.6
@nrwl/linter : 13.10.6
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : 14.4.3
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : Not Found
@nrwl/web : Not Found
@nrwl/workspace : 13.10.6
typescript : 4.6.4
rxjs : 6.6.7
---------------------------------------
Community plugins:
Issue Analytics
- State:
- Created a year ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Yarn install error: NX Cannot read properties of undefined ...
I encount this issue a lot of times. Just remove the ".cache/nx" folder in your node_modules and re-run your command.
Read more >nx cannot read properties of undefined (reading 'endswith')
When I generate a local plugin and attempt to run it (or any Nx command), I get this error message. Cannot read properties...
Read more >How to Avoid the Infamous "Cannot read properties of ... - Bitovi
That error message is telling you the function is returning undefined implicitly, but its return type does not include undefined in it. Awesome!...
Read more >TypeError: Cannot read property 'startsWith' of undefined
Then the error appears when i try to run node index.js inside src folder. if I replace the process.env.MOGNGO_CONNECTION_STRING variable by this ...
Read more >Cannot read property 'endsWith' of undefined - Salesforce ...
Salesforce DX: Lightning testing service run with · November 23, 2017; ·; Reply · Reply · Like; 0; ·; Follow; 1 · Like;...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @AndrewOttavianoAbb, it may be unrelated, but some of your @nrwl/* packages don’t line up with the version of
nx
you have installed. Aside from@nrwl/nx-cloud
, all packages under the nrwl scope should generally be set up with the same version.Can you correct this and check that the issue still reproduces? An easy way to fix this would be to run
nx migrate {v}
, wherev
is the version of nx you have installed. Alternatively, updating to latest withnx migrate latest
would also work.I’m going to go ahead and close this one out, it looks like this 8s just an out of sync deps issue for those involved.