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

Cannot read properties of undefined (reading 'data') when migrating from v14.6.0 to v15.3+ #13776

Closed
dgbau opened this issue Dec 12, 2022 · 11 comments · Fixed by #13803
Closed
Assignees
Labels

Comments

@dgbau
Copy link

dgbau commented Dec 12, 2022

Current Behavior

Upon trying to run serve after migrating to version 15.3.x, I get an error when trying to serve a react application. Resetting to v14.6.0 and updating to version as recent as 15.2.4 works correctly.

Expected Behavior

Should be able to run react application in development mode as in prior versions.

Github Repo

private repo

Steps to Reproduce

  1. from a repo with a react app and react, other lib modules running 14.6.0, run npx nx migrate @nrwl/workspace@15.2.4
  2. run npx nx migrate --run-migrations when complete`
  3. run npx nx serve <appname>

Nx Report

>  NX   Report complete - copy this into the issue template

   Node : 18.12.1
   OS   : darwin x64
   npm  : 8.19.2
   
   nx : 15.2.4
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.2.4
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.2.4
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.2.4
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 15.2.4
   @nrwl/js : 15.2.4
   @nrwl/linter : 15.2.4
   @nrwl/nest : Not Found
   @nrwl/next : 15.2.4
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 15.2.4
   @nrwl/react-native : Not Found
   @nrwl/rollup : 15.2.4
   @nrwl/schematics : Not Found
   @nrwl/storybook : 15.2.4
   @nrwl/web : 15.2.4
   @nrwl/webpack : 15.2.4
   @nrwl/workspace : 15.2.4
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:

Failure Logs

>  NX   Cannot read properties of undefined (reading 'data')

Additional Information

I tried stepping forward through releases up until v15.3.0 and the releases prior to this all will serve the react application. there are no lines in my app that refer to a data attribute on an object, unguarded.

@JoA-MoS
Copy link
Contributor

JoA-MoS commented Dec 13, 2022

I am also seeing this on commands that don't requires specifying a project

npx nx workspace-lint
npx nx format:check

@alpavlove
Copy link

alpavlove commented Dec 13, 2022

The same thing happens when I run nx affected --target=lint --parallel --max-parallel=3. Today I switched from v15.3.0 to v15.3.2. The problem disappeared when I switched back to nx@15.3.0

@JoA-MoS
Copy link
Contributor

JoA-MoS commented Dec 13, 2022

The same thing happens when I run nx affected --target=lint --parallel --max-parallel=3. Today I switched from v15.3.0 to v15.3.2. The problem disappeared when I switched back to nx@15.3.0

I had the same experience

@alexfriesen
Copy link

alexfriesen commented Dec 13, 2022

same here. when running some build commands with --verbose it gives me this:

{
  stack: "TypeError: Cannot read properties of undefined (reading 'data')\n" +
    '    at /home/project/node_modules/nx/src/lock-file/utils/hashing.js:43:37\n' +
    '    at Array.forEach (<anonymous>)\n' +
    '    at traverseExternalNodesDependencies (/home/project/node_modules/nx/src/lock-file/utils/hashing.js:41:37)\n' +
    '    at hashExternalNode (/home/project/node_modules/nx/src/lock-file/utils/hashing.js:36:9)\n' +
    '    at /home/project/node_modules/nx/src/lock-file/utils/hashing.js:23:13\n' +
    '    at Array.forEach (<anonymous>)\n' +
    '    at hashExternalNodes (/home/project/node_modules/nx/src/lock-file/utils/hashing.js:20:45)\n' +
    '    at mapLockFileDataToPartialGraph (/home/project/node_modules/nx/src/lock-file/lock-file.js:95:41)\n' +
    '    at /home/project/node_modules/nx/src/project-graph/build-project-graph.js:61:78\n' +
    '    at Generator.next (<anonymous>)',
  message: "Cannot read properties of undefined (reading 'data')\n" +
    '\n' +
    'Because of the error the Nx daemon process has exited. The next Nx command is going to restart the daemon process.\n' +
    'If the error persists, please run "nx reset".'
}

@blackfan23
Copy link

Not a solution per se, but for me, backing up and deleting the lockfile helped temporarily, so that I could continue coding tonight.

@bouchardm
Copy link

Same thing for me, I had to revert to 14.8.6

@JoA-MoS
Copy link
Contributor

JoA-MoS commented Dec 14, 2022

I think adding the property "nx":{} to my package.json solved some things but nothing felt consistent so I backed back down to 15.3.0

@jvinis
Copy link

jvinis commented Dec 14, 2022

the problem was solved by reverting to 15.3.0 from 15.3.3

MBuchalik added a commit to jvalue/jayvee that referenced this issue Dec 14, 2022
MBuchalik added a commit to jvalue/jayvee that referenced this issue Dec 14, 2022
@meeroslav
Copy link
Contributor

For a quick remedy, you can downgrade Nx to 15.3.0.

The fix by @AgentEnder will be merged today and rolled out in the next patch.

Sorry for the inconvenience.

@toniocodo
Copy link

Experiencing the same issue when upgarding to 15.3.3, waiting for the fix

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants