-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed as not planned
Closed as not planned
Copy link
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
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 wrapsrequire.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:
- Initially written with
require.resolve
: (fix(nextjs): Addsentry-cli
existence check for enabling webpack plugin #4311) - then wrapped with
eval
: (ref(nextjs): Update webpack-plugin and change how cli binary is detected #4988) - and then to the latest impl that uses
path.resolve
: (fix(nextjs): Stop usingeval
when checking forsentry-cli
binary #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 true
Actual Result
ensureCLIBinaryExists()
returns false even with @sentry/cli
installed.
Metadata
Metadata
Assignees
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK