Closed artechventure closed 5 days ago
hi @artechventure, which yarn version are you using?
hi @artechventure, which yarn version are you using?
Hi, I'm using 4.0.2
I was able to reproduce it, thanks for pointing that out. We'll put in on our backlog. Meanwhile you can revert to any yarn node-linker that uses node_modules
, sorry for the inconvenience!
Im seeing this error with nodeLinker: pnpm
- is that expected? We really don't want to have t o use node-modules
linker if possible, this seems to be our only issue switching to pnpm
@wwarby yeah I need to re-visit this. Are you using pnpm workspaces?
I am encountering this issue on a TurboRepo mono-repo (npm workspaces) FYI, having to downgrade back to Sentry v7.
Can confirm that its because of this line:
sentry-javascript/packages/utils/src/node.ts
Line 57 in 0d79b51
mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) as T;
Since npm has hoisted the package to the top of the workspace /node_modules/, however sentry is looking in the current path of the subpackage/node_moduels/
@wwarby yeah I need to re-visit this. Are you using pnpm workspaces?
I don't think so. We're just using plain Yarn with this in our .yarnrc.yml
file. The build works if I change nodeLinker to node-modules
.
nodeLinker: pnpm
enableGlobalCache: false
yarnPath: .yarn/releases/yarn-4.5.0.cjs
I'm using this for now:
Edit: This is not a real solution, as it requires @sentry/utils
to have a dependency on @sentry/webpack-plugin
. (And it was generated by ChatGPT.)
I am encountering this issue on a TurboRepo mono-repo (npm workspaces) FYI, having to downgrade back to Sentry v7.
Can confirm that its because of this line:
sentry-javascript/packages/utils/src/node.ts
Line 57 in 0d79b51
mod = dynamicRequire(module,
${cwd()}/node_modules/${moduleName}
) as T; Since npm has hoisted the package to the top of the workspace /node_modules/, however sentry is looking in the current path of the subpackage/node_moduels/
Same here. No pnpm or Yarn, just plain npm workspaces.
Once this is released there will be an automated comment in this issue. Please leave a message here if you still encounter problems afterwards!
This issue was referenced by PR #13751, which was included in the 8.37.0 release.
Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/nextjs
SDK Version
8.29.0
Framework Version
Next 14.2.5
Link to Sentry event
No response
Reproduction Example/SDK Setup
https://github.com/getsentry/sentry-javascript/blob/0d79b51e7ecbe26b1b235ed92410d2d07febdcde/packages/nextjs/src/config/webpack.ts#L335
Above part changed 6 months ago, I believe it fails on Yarn PnP since then.
https://github.com/getsentry/sentry-javascript/blob/0d79b51e7ecbe26b1b235ed92410d2d07febdcde/packages/utils/src/node.ts#L57
Inside function
loadmodule
, node_modules is hard-coded which will always returnsundefined
Steps to Reproduce
withSentryConfig
from@sentry/nextjs
inside next.config.jsnext build
Expected Result
Build success
Actual Result
TypeError: Cannot destructure property 'sentryWebpackPlugin' of 'utils.loadModule(...)' as it is undefined.