Closed muuvmuuv closed 3 years ago
Seems a remove of node_modules fixed the problem
nx clear-cache
Ok so I have been having this issue lately, before I never had it all. It's very odd. The only way I have found to resolve it is to use to remove package-lock.json, and node_modules/ folder and then running npm i
. I tried nx clear-cache, I tried deleting ONLY the node_modules/ folder and running npm i
but none of that worked.
issue seems to be yocto-queue
in npm-packages.js I updated it to print the issue:
const npmPackage = npmPackages.find((pkg) => {
console.log(`${pkg.data.packageName} === ${c.path[1]}`, pkg.data, c.path);
return pkg.data.packageName === c.path[1];
}
);
console.log('npmPackage', npmPackage);
the last thing it prints is:
yocto-queue === eslint-plugin-import {
version: '0.1.0',
packageName: 'yocto-queue',
hash: '1acee86624de498294338c33ed08242cc253872a79dffd778f2287b144fbd853'
} [ 'devDependencies', 'eslint-plugin-import' ]
npmPackage undefined
nx.js affected
TypeError: Cannot read properties of undefined (reading 'name')
at getTouchedNpmPackages (/actions-toolkit/node_modules/nx/src/project-graph/affected/locators/npm-packages.js:30:39)
I don't know if this is relevant or useful for somebody else.
Something similar happened to me with wagmi and yarn
. The exact same output happened specifically after installing that package (so probably some other packages are presenting the same behaviour).
Nothing worked other than switching to npm
. Not the best solution but it works in the meantime.
@zoix I got repro of this too
For me the issue is fixed by downgrading from 15.3
to 15.2
. Unfortunatelly didn't spend much time trying to figure out what was wrong. If I will find the problem I will post it here
I could not get any of the above to work even after removing node_modules and package-lock.json. No matter what nx command I type, it just prints "Cannot read properties of undefined (reading 'data')". There is no useful stack trace or any other information (does nx have a verbose mode?). The only thing that worked for me was to migrate to 15.2.4 (instead of 15.3.3)
Same here. Reverting to 15.2.4 solved the issue.
Started working again after upgrading to 15.4.4
.
I have the same exact thing
> NX Cannot read properties of undefined (reading 'data')
HookWebpackError: Cannot read properties of undefined (reading 'data')
at makeWebpackError (/workspace-dir/node_modules/webpack/lib/HookWebpackError.js:48:9)
at /workspace-dir/node_modules/webpack/lib/Compilation.js:3060:12
at eval (eval at create (/workspace-dir/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:95:1)
at fn (/workspace-dir/node_modules/webpack/lib/Compilation.js:480:17)
at _next0 (eval at create (/workspace-dir/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:93:1)
at eval (eval at create (/workspace-dir/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:106:1)
at eval (eval at create (/workspace-dir/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:14:1)
-- inner error --
TypeError: Cannot read properties of undefined (reading 'data')
at pathLengthToIncoming (/workspace-dir/node_modules/nx/src/lock-file/project-graph-pruning.js:128:37)
at /workspace-dir/node_modules/nx/src/lock-file/project-graph-pruning.js:97:34
at Array.forEach (<anonymous>)
at /workspace-dir/node_modules/nx/src/lock-file/project-graph-pruning.js:96:25
at Map.forEach (<anonymous>)
at rehoistNodes (/workspace-dir/node_modules/nx/src/lock-file/project-graph-pruning.js:87:23)
at pruneProjectGraph (/workspace-dir/node_modules/nx/src/lock-file/project-graph-pruning.js:17:5)
at createLockFile (/workspace-dir/node_modules/nx/src/lock-file/lock-file.js:112:75)
at /workspace-dir/node_modules/@nrwl/webpack/src/plugins/generate-package-json-plugin.js:43:131
at fn (/workspace-dir/node_modules/webpack/lib/Compilation.js:478:10)
at _next0 (eval at create (/workspace-dir/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:93:1)
at eval (eval at create (/workspace-dir/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:106:1)
at eval (eval at create (/workspace-dir/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:14:1)
Same problem here after upgrade to 15.7.2
NX Cannot read properties of undefined (reading 'data')
HookWebpackError: Cannot read properties of undefined (reading 'data')
In all these years, NX is by far the worst library I have ever worked with. Not even once has it worked without problems. It is interesting that even the project that works today may fail tomorrow without any changes and waste hours of your time to find the problem.
In all these years, NX is by far the worst library I have ever worked with
Definitely do not agree. Works fine for me.
Can you create reproduction repository with such error?
In all these years, NX is by far the worst library I have ever worked with
Definitely do not agree. Works fine for me.
Can you create reproduction repository with such error?
Yes, because it is much easier to count its advantages than its disadvantages Does the fact that it works well for you mean that it works well for others? The easiest way to find out the reality of this issue is to use it only a few times and measure the time it takes to fix its problems.
Can you create a reproduction repository with such an error? No. A few months ago I reported a bug from NX that still persists. NX is one of those libraries that prefers to add new features instead of fixing bugs.
This is happening with pnpm v8 lockfile version 6
This issue is still happening! I'm using latest stable version of NX and PNPM
NX An error occurred while creating pruned lockfile.
Please open an issue at `https://github.com/nrwl/nx/issues/new?template=1-bug.yml` and provide a reproduction.
To prevent the build from breaking, we are returning the root lock file.
Original error: Cannot read properties of undefined (reading 'data')
TypeError: Cannot read properties of undefined (reading 'data')
at findNodeMatchingVersion (/home/user/Workspace/repos/project/node_modules/.pnpm/nx@15.8.6_@swc+core@1.3.41/node_modules/nx/src/lock-file/project-graph-pruning.js:55:75)
at /home/user/Workspace/repos/project/node_modules/.pnpm/nx@15.8.6_@swc+core@1.3.41/node_modules/nx/src/lock-file/project-graph-pruning.js:35:22
at Array.forEach (<anonymous>)
at normalizeDependencies (/home/user/Workspace/repos/project/node_modules/.pnpm/nx@15.8.6_@swc+core@1.3.41/node_modules/nx/src/lock-file/project-graph-pruning.js:26:42)
at pruneProjectGraph (/home/user/Workspace/repos/project/node_modules/.pnpm/nx@15.8.6_@swc+core@1.3.41/node_modules/nx/src/lock-file/project-graph-pruning.js:13:34)
at createLockFile (/home/user/Workspace/repos/project/node_modules/.pnpm/nx@15.8.6_@swc+core@1.3.41/node_modules/nx/src/lock-file/lock-file.js:128:79)
at /home/user/Workspace/repos/project/node_modules/.pnpm/@nrwl+webpack@15.8.6_@babel+core@7.21.3_@swc+core@1.3.41_@types+node@18.15.5_esbuild@0.16.3_e_gvqnucmt2z3seuptjrodxr2vsi/node_modules/@nrwl/webpack/src/plugins/generate-package-json-plugin.js:42:131
at fn (/home/user/Workspace/repos/project/node_modules/.pnpm/webpack@5.76.2_@swc+core@1.3.41_esbuild@0.16.3/node_modules/webpack/lib/Compilation.js:478:10)
at Hook.eval [as callAsync] (eval at create (/home/user/Workspace/repos/project/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:20:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/user/Workspace/repos/project/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/Hook.js:18:14)
nx injects too way deep into next js, and works horrible :(
spent almost 2 days to find out that output:standalone is completely broken, and those withNx plugins for next.config.js don't work properly...
having same problem after upgrading to 16.3.2
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.
Current Behavior
Running
nx serve
after migrating to 13 produces an error. Could that be because prettier has an incorrect version?Expected Behavior
Steps to Reproduce
Haven't tested yet (going to after setting up a 12 workspace):
nx serve
Failure Logs
package.json Diff
Environment