Title: Updated `ensureCLIBinaryExists` does not work properly with Yarn Berry (PnP) · Issue #5632 · getsentry/sentry-javascript · GitHub
Open Graph Title: Updated `ensureCLIBinaryExists` does not work properly with Yarn Berry (PnP) · Issue #5632 · getsentry/sentry-javascript
X Title: Updated `ensureCLIBinaryExists` does not work properly with Yarn Berry (PnP) · Issue #5632 · getsentry/sentry-javascript
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/...
Open Graph 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 th...
X 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 th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/5632
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Updated `ensureCLIBinaryExists` does not work properly with Yarn Berry (PnP)","articleBody":"### Is there an existing issue for this?\r\n\r\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\r\n- [X] I have reviewed the documentation https://docs.sentry.io/\r\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\r\n\r\n### How do you use Sentry?\r\n\r\nSentry Saas (sentry.io)\r\n\r\n### Which package are you using?\r\n\r\n@sentry/nextjs\r\n\r\n### SDK Version\r\n\r\n7.11.1\r\n\r\n### Framework Version\r\n\r\n12.2.5\r\n\r\n### Link to Sentry event\r\n\r\nN/A\r\n\r\n### Steps to Reproduce\r\n\r\nhttps://yarnpkg.com/features/pnp\r\n\r\nLatest `ensureCLIBinaryExists()` impl:\r\n```ts\r\nfunction ensureCLIBinaryExists(): boolean {\r\n for (const node_modulesPath of module.paths) {\r\n if (fs.existsSync(path.resolve(node_modulesPath, '@sentry/cli/sentry-cli'))) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n```\r\n\r\nThis has an issue with Yarn PnP:\r\n- Yarn PnP does not install things under `node_modules/`.\r\n- However it has helper functions in `.pnp.cjs` which wraps `require.resolve`, `fs.*` functions to work with their Zip archived dependency installations.\r\n- Thus `path.resolve()` is not able to find `@sentry/cli/sentry-cli` when they are installed with Yarn PnP.\r\n\r\nI have found that `ensureCLIBinaryExists()` has following history of:\r\n- Initially written with `require.resolve`: (https://github.com/getsentry/sentry-javascript/pull/4311)\r\n- then wrapped with `eval`: (https://github.com/getsentry/sentry-javascript/pull/4988)\r\n- and then to the latest impl that uses `path.resolve`: (https://github.com/getsentry/sentry-javascript/pull/5447)\r\n\r\nHowever the latest one does not work well with Yarn PnP. Currently we have downgraded sentry SDK to 7.7.0 mitigate this issue.\r\n\r\n### Expected Result\r\n\r\n`ensureCLIBinaryExists()` returns true\r\n\r\n### Actual Result\r\n\r\n`ensureCLIBinaryExists()` returns false even with `@sentry/cli` installed.","author":{"url":"https://github.com/vhain","@type":"Person","name":"vhain"},"datePublished":"2022-08-25T00:35:55Z","url":"https://github.com/getsentry/sentry-javascript/issues/5632"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fbed6d4f-953d-0155-8e65-02f0863762a6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E50C:2D47A6:7B2215:A523FB:6B04A75F |
| html-safe-nonce | b9e532ced176530c5662d4d5ff5ed928061fd9b887a1999809c4a6e28fa531d3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTBDOjJENDdBNjo3QjIyMTU6QTUyM0ZCOjZCMDRBNzVGIiwidmlzaXRvcl9pZCI6IjIyMzA1ODA0NzM3MjAyNTIyNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 83c7a7488ab5fbfb0bbe20a2e8a5021e636e95098942792489f1369afb4c8995 |
| hovercard-subject-tag | issue:1350163416 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/5632/issue_layout |
| twitter:image | https://opengraph.githubassets.com/47c4d7cc306404094d3299d0af88271f18814d4d3d972894fa24a5f289aaa3e5/getsentry/sentry-javascript/issues/5632 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/47c4d7cc306404094d3299d0af88271f18814d4d3d972894fa24a5f289aaa3e5/getsentry/sentry-javascript/issues/5632 |
| og:image:alt | 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 th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vhain |
| hostname | github.com |
| expected-hostname | github.com |
| None | 188497a0f45a7aa8f7c866faa1950d1a7f8d82b59416adf549b222ad1d1dd19b |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 557cfbac6cdb532730c95c90f2cefdc0c4128029 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width