René's URL Explorer Experiment


Title: `@sentry/tracing` does not work with modern `yarn` (in PnP mode) · Issue #4076 · getsentry/sentry-javascript · GitHub

Open Graph Title: `@sentry/tracing` does not work with modern `yarn` (in PnP mode) · Issue #4076 · getsentry/sentry-javascript

X Title: `@sentry/tracing` does not work with modern `yarn` (in PnP mode) · Issue #4076 · getsentry/sentry-javascript

Description: Package + Version @sentry/node: 6.13.3 @sentry/tracing: 6.13.3 Version: 6.13.3 Description While trying to add tracing instrumentation for mongoose in a nodejs app that uses Yarn 3.0 in PnP mode I noticed that nothing was happening, and ...

Open Graph Description: Package + Version @sentry/node: 6.13.3 @sentry/tracing: 6.13.3 Version: 6.13.3 Description While trying to add tracing instrumentation for mongoose in a nodejs app that uses Yarn 3.0 in PnP mode I ...

X Description: Package + Version @sentry/node: 6.13.3 @sentry/tracing: 6.13.3 Version: 6.13.3 Description While trying to add tracing instrumentation for mongoose in a nodejs app that uses Yarn 3.0 in PnP mode I ...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/4076

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`@sentry/tracing` does not work with modern `yarn` (in PnP mode)","articleBody":"## Package + Version\r\n\r\n- [x] `@sentry/node`: 6.13.3\r\n- [x] `@sentry/tracing`: 6.13.3\r\n\r\n### Version:\r\n\r\n```\r\n6.13.3\r\n```\r\n\r\n## Description\r\n\r\nWhile trying to add tracing instrumentation for `mongoose` in a nodejs app that uses Yarn 3.0 in PnP mode I noticed that nothing was happening, and tracing was silently failing to do anything.\r\n\r\nThe problem is that PnP mode is strict about which dependencies are allowed to be required, and a package that doesn't define the dep in its package.json (dependencies or peerDependencies) will not be able to require it.\r\n\r\nSee: https://yarnpkg.com/advanced/rulebook/#packages-should-only-ever-require-what-they-formally-list-in-their-dependencies\r\n\r\nNeither `@sentry/tracing` or `@sentry/utils` list `mongoose`/`mongodb`/`pg`/`mysql` as dependencies.\r\n\r\nThe reason this fails is:\r\n\r\nhttps://github.com/getsentry/sentry-javascript/blob/84a6dc041567f6b4486183ccabbd078a48225304/packages/tracing/src/integrations/node/mongo.ts#L122-L123\r\n\r\nWhich then delegates to:\r\n\r\nhttps://github.com/getsentry/sentry-javascript/blob/84a6dc041567f6b4486183ccabbd078a48225304/packages/utils/src/node.ts#L42-L46\r\n\r\nThat empty catch actually suppresses this error:\r\n\r\n```\r\nError: @sentry/utils tried to access mongoose (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.\r\n\r\nRequired package: mongoose\r\nRequired by: @sentry/utils@virtual:...\r\n\r\nAncestor breaking the chain: @sentry/core@npm:6.13.3\r\nAncestor breaking the chain: @sentry/hub@npm:6.13.3\r\nAncestor breaking the chain: @sentry/node@npm:6.13.3\r\n```\r\n\r\nThis is going to be tricky to fix because of the long chain of dependencies needing to pass the target dependency along properly.\r\n\r\nOne possible suggestion to get around this would be to:\r\n - make the error clearer to the user\r\n - make it possible to inject the library via the constructor in:\r\n   https://github.com/getsentry/sentry-javascript/blob/84a6dc041567f6b4486183ccabbd078a48225304/packages/tracing/src/integrations/node/mongo.ts#L85-L89\r\n  \r\n  The caller might then do something like:\r\n  ```ts\r\n  const MongoTracingIntegration = new Tracing.Integrations.Mongo({\r\n    collection: require(\"mongoose\").Collection,\r\n  });\r\n  ```\r\n  This would bypass the `require` call being done by the sentry library, and delegate it to the user instead, providing a way around the problem.\r\n\r\nSomething similar would need to be done with all the other integrations.\r\n\r\nSlightly related: https://github.com/getsentry/sentry-javascript/issues/3172 (different issue on PnP)","author":{"url":"https://github.com/andreialecu","@type":"Person","name":"andreialecu"},"datePublished":"2021-10-19T09:03:28Z","url":"https://github.com/getsentry/sentry-javascript/issues/4076"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3ca4a772-e7b4-2c8f-d001-3a8fa4ac6ff0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD7EC:BE8D0:59B1F3:7E2830:6B0475C5
html-safe-nonced744d71454d11c749f41ebc0426db77a5a8f965769cb12594066e99909fc89a9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0VDOkJFOEQwOjU5QjFGMzo3RTI4MzA6NkIwNDc1QzUiLCJ2aXNpdG9yX2lkIjoiMjEzMTQ4NDA5Nzc1MzkzNzM0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8bd0a5d4ff0585d2e282ec1affa4d57d0c7577be735e65632efb9e09fa3f1bab
hovercard-subject-tagissue:1030046187
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/4076/issue_layout
twitter:imagehttps://opengraph.githubassets.com/937e721a982facaaccd05e6cbf51997d80c8444faecb2d82fe8907da4f82c327/getsentry/sentry-javascript/issues/4076
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/937e721a982facaaccd05e6cbf51997d80c8444faecb2d82fe8907da4f82c327/getsentry/sentry-javascript/issues/4076
og:image:altPackage + Version @sentry/node: 6.13.3 @sentry/tracing: 6.13.3 Version: 6.13.3 Description While trying to add tracing instrumentation for mongoose in a nodejs app that uses Yarn 3.0 in PnP mode I ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameandreialecu
hostnamegithub.com
expected-hostnamegithub.com
None9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecf73f57448d52b3a7b619195e182b33d3b3454ca
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/4076#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F4076
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F4076
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/4076
Reloadhttps://github.com/getsentry/sentry-javascript/issues/4076
Reloadhttps://github.com/getsentry/sentry-javascript/issues/4076
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues339 (339)https://github.com/getsentry/sentry-javascript/issues
Pull requests54 (54)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/4076
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/4076
@sentry/tracing does not work with modern yarn (in PnP mode)https://github.com/getsentry/sentry-javascript/issues/4076#top
Type: Improvementhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Type%3A%20Improvement%22
https://github.com/andreialecu
andreialecuhttps://github.com/andreialecu
on Oct 19, 2021https://github.com/getsentry/sentry-javascript/issues/4076#issue-1030046187
https://yarnpkg.com/advanced/rulebook/#packages-should-only-ever-require-what-they-formally-list-in-their-dependencieshttps://yarnpkg.com/advanced/rulebook/#packages-should-only-ever-require-what-they-formally-list-in-their-dependencies
sentry-javascript/packages/tracing/src/integrations/node/mongo.tshttps://github.com/getsentry/sentry-javascript/blob/84a6dc041567f6b4486183ccabbd078a48225304/packages/tracing/src/integrations/node/mongo.ts#L122-L123
84a6dc0https://github.com/getsentry/sentry-javascript/commit/84a6dc041567f6b4486183ccabbd078a48225304
sentry-javascript/packages/utils/src/node.tshttps://github.com/getsentry/sentry-javascript/blob/84a6dc041567f6b4486183ccabbd078a48225304/packages/utils/src/node.ts#L42-L46
84a6dc0https://github.com/getsentry/sentry-javascript/commit/84a6dc041567f6b4486183ccabbd078a48225304
sentry-javascript/packages/tracing/src/integrations/node/mongo.tshttps://github.com/getsentry/sentry-javascript/blob/84a6dc041567f6b4486183ccabbd078a48225304/packages/tracing/src/integrations/node/mongo.ts#L85-L89
84a6dc0https://github.com/getsentry/sentry-javascript/commit/84a6dc041567f6b4486183ccabbd078a48225304
#3172https://github.com/getsentry/sentry-javascript/issues/3172
getsantryhttps://github.com/apps/getsantry
Status: Untriagedhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Untriaged%22
on Oct 19, 2021https://github.com/getsentry/sentry-javascript/issues/4076#event-5483777120
andreialecuhttps://github.com/andreialecu
on Oct 19, 2021https://github.com/getsentry/sentry-javascript/issues/4076#event-5484395293
fix(utils): Fix `loadModule` when using PnPhttps://github.com/andreialecu/sentry-javascript/commit/8f344d03d59d3db2ee605eaf152fe5bef9a39a54
https://docs.github.com/articles/closing-issues-via-commit-messages
8f344d0https://github.com/andreialecu/sentry-javascript/commit/8f344d03d59d3db2ee605eaf152fe5bef9a39a54
https://github.com/andreialecu
andreialecuhttps://github.com/andreialecu
on Oct 19, 2021https://github.com/getsentry/sentry-javascript/issues/4076#issuecomment-946606221
#4077https://github.com/getsentry/sentry-javascript/pull/4077
andreialecuhttps://github.com/andreialecu
on Oct 19, 2021https://github.com/getsentry/sentry-javascript/issues/4076#event-5484445829
fix(utils): Fix `loadModule` when using PnPhttps://github.com/andreialecu/sentry-javascript/commit/7a0b28e7278caa95c0391a072d0cca602c7a569f
https://docs.github.com/articles/closing-issues-via-commit-messages
7a0b28ehttps://github.com/andreialecu/sentry-javascript/commit/7a0b28e7278caa95c0391a072d0cca602c7a569f
fix(utils): Fix `loadModule` when using PnPhttps://github.com/andreialecu/sentry-javascript/commit/1f49b46ea8929480c988ea22e3b1135afa49abf3
https://docs.github.com/articles/closing-issues-via-commit-messages
1f49b46https://github.com/andreialecu/sentry-javascript/commit/1f49b46ea8929480c988ea22e3b1135afa49abf3
iker-barriocanalhttps://github.com/iker-barriocanal
Package: nodehttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Package%3A%20node%22
Type: Improvementhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Type%3A%20Improvement%22
Status: Untriagedhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Untriaged%22
on Oct 20, 2021https://github.com/getsentry/sentry-javascript/issues/4076#event-5491005732
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Nov 10, 2021https://github.com/getsentry/sentry-javascript/issues/4076#issuecomment-965068086
github-actionshttps://github.com/apps/github-actions
Status: Stalehttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Stale%22
on Nov 10, 2021https://github.com/getsentry/sentry-javascript/issues/4076#event-5596577712
github-actionshttps://github.com/apps/github-actions
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 17, 2021https://github.com/getsentry/sentry-javascript/issues/4076#event-5631452174
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/4076
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/4076
Type: Improvementhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Type%3A%20Improvement%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.