You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Subsequent to #21492, we upgraded to 18.3.4 which contains the fix, and removed our hacky workaround where we call nx reset after running pnpm install due to the daemon server panicing in the Rust code.
We now see a different error:
[NX Daemon Server] - 2024-04-26T11:14:25.496Z - [WATCHER]: Unexpected workspace error Cannot read properties of null (reading 'message')
TypeError: Cannot read properties of null (reading 'message')
at handleWorkspaceChanges (/<redacted>/node_modules/.pnpm/nx@18.3.4_@swc+core@1.3.100_@swc+helpers@0.5.1_/node_modules/nx/src/daemon/server/server.js:203:90)
at /<redacted>/ui/node_modules/.pnpm/nx@18.3.4_@swc+core@1.3.100_@swc+helpers@0.5.1_/node_modules/nx/src/daemon/server/watcher.js:36:9
Expected Behavior
We would expect the daemon not to crash when running pnpm install
This isn't a proper solution - pnpm 9 may be needed for certain projects (also, regressions shouldn't be solved by "just downgrade" - unless the maintainers of the affected software indicate that's the intended solution).
If the quoted text is intended as a workaround, rephrasing to will workaround would make the intent more clear :)
(edit: if the above came off as aggressive, that wasnt my intent, sorry abt that - idk how to phrase this in a more lighthearted way)
A possible solution would be to, wherever the relevant source code is (im just patching the output to get my setup working temporarily as a workaround whilst testing) use something like logger_1.serverLogger.watcherLog('Unexpected workspace watcher error', error?.message ?? error); instead of logger_1.serverLogger.watcherLog('Unexpected workspace watcher error', error.message); (or, on the line above that, do let error = err instanceof Error ? err : new Error(err) : err; rather than let error = typeof err === 'string' ? new Error(err) : err;).
Might submit a PR soon-ish if I feel like it.
Interestingly, in my short testing, replacing it with anything to get the value of err results in everything "just working"; no error being thrown by nx, even after running nx reset and trying again.
Interestingly, in my short testing, replacing it with anything to get the value of err results in everything "just working"; no error being thrown by nx, even after running nx reset and trying again.
Update: found the root cause after a bit more messing around trying to get err outputted (i still dont know why it just randomly "worked" half the time when I tried to get it to output the value of it); err is null and the if block is getting triggered by the !changeEvents || !changeEvents.length, resulting in err not being an instance of a string (meaning the new Error doesn't get triggered) and the .message property being indexed.
Will submit a PR in a moment. Nx tests fail both on master and with my commit, cba to figure them out right now - I'll leave the patch discussed in the last comment for someone else to make a PR for :)
Current Behavior
Subsequent to #21492, we upgraded to 18.3.4 which contains the fix, and removed our hacky workaround where we call
nx reset
after runningpnpm install
due to the daemon serverpanic
ing in the Rust code.We now see a different error:
Expected Behavior
We would expect the daemon not to crash when running
pnpm install
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
pnpm 9.0.2
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: