Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/nextjs
SDK Version
7.11.1
Framework Version
12.2.5
Link to Sentry event
N/A
Steps to Reproduce
https://yarnpkg.com/features/pnp
Latest ensureCLIBinaryExists() impl:
function ensureCLIBinaryExists(): boolean {
for (const node_modulesPath of module.paths) {
if (fs.existsSync(path.resolve(node_modulesPath, '@sentry/cli/sentry-cli'))) {
return true;
}
}
return false;
}
This has an issue with Yarn PnP:
- Yarn PnP does not install things under
node_modules/.
- However it has helper functions in
.pnp.cjs which wraps require.resolve, fs.* functions to work with their Zip archived dependency installations.
- Thus
path.resolve() is not able to find @sentry/cli/sentry-cli when they are installed with Yarn PnP.
I have found that ensureCLIBinaryExists() has following history of:
However the latest one does not work well with Yarn PnP. Currently we have downgraded sentry SDK to 7.7.0 mitigate this issue.
Expected Result
ensureCLIBinaryExists() returns true
Actual Result
ensureCLIBinaryExists() returns false even with @sentry/cli installed.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/nextjs
SDK Version
7.11.1
Framework Version
12.2.5
Link to Sentry event
N/A
Steps to Reproduce
https://yarnpkg.com/features/pnp
Latest
ensureCLIBinaryExists()impl:This has an issue with Yarn PnP:
node_modules/..pnp.cjswhich wrapsrequire.resolve,fs.*functions to work with their Zip archived dependency installations.path.resolve()is not able to find@sentry/cli/sentry-cliwhen they are installed with Yarn PnP.I have found that
ensureCLIBinaryExists()has following history of:require.resolve: (fix(nextjs): Addsentry-cliexistence check for enabling webpack plugin #4311)eval: (ref(nextjs): Update webpack-plugin and change how cli binary is detected #4988)path.resolve: (fix(nextjs): Stop usingevalwhen checking forsentry-clibinary #5447)However the latest one does not work well with Yarn PnP. Currently we have downgraded sentry SDK to 7.7.0 mitigate this issue.
Expected Result
ensureCLIBinaryExists()returns trueActual Result
ensureCLIBinaryExists()returns false even with@sentry/cliinstalled.