René's URL Explorer Experiment


Title: Custom path options for SENTRY_SERVER_INIT_PATH to use in monorepo environments. · Issue #3723 · getsentry/sentry-javascript · GitHub

Open Graph Title: Custom path options for SENTRY_SERVER_INIT_PATH to use in monorepo environments. · Issue #3723 · getsentry/sentry-javascript

X Title: Custom path options for SENTRY_SERVER_INIT_PATH to use in monorepo environments. · Issue #3723 · getsentry/sentry-javascript

Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javascript/releases Provide a link to the aff...

Open Graph Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...

X Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Custom path options for SENTRY_SERVER_INIT_PATH to use in monorepo environments.","articleBody":"- [x] Review the documentation: https://docs.sentry.io/\r\n- [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues\r\n- [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases\r\n- [ ] Provide a link to the affected event from your Sentry account\r\n\r\n## Package + Version\r\n\r\n- [x] `@sentry/nextjs`\r\n\r\n### Version:\r\n\r\n```\r\n6.7.1\r\n```\r\n\r\n## Description\r\n\r\nWhen using `@sentry/nextjs` in a [@nrwl/nx](https://nx.dev) monorepo workspace environment, the output path is applied to `.env.local` file relative to the \"application\" path, which resolves to this in development environment (as `dist` folder is in workspace root but app source is in `apps/\u003capp-name>` directory):\r\n\r\n```\r\nSENTRY_SERVER_INIT_PATH=..\\..\\dist\\apps\\\u003capp-name>\\.next\\server\\sentry\\initServerSDK.js\r\n```\r\n\r\nWhich is correct as it gets the output from the webpack config. But in the nx workspace environment, the serve and build commands must be executed from the workspace root and not the next app root, so this relative path becomes wrong for both the development server and the production build pipeline (as in most cases only the built artifacts are cloned over).\r\n\r\nSo this error is thrown:\r\n```\r\n[Sentry] Could not initialize SDK. Received error:\r\nError: Cannot find module 'C:\\Users\\\u003cusername>\\Desktop\\dist\\apps\\\u003capp-name>\\.next\\server\\sentry\\initServerSDK.js'\r\nRequire stack:\r\n- C:\\Users\\\u003cusername>\\Desktop\\Dev\\\u003cworkspace-name>\\node_modules\\@sentry\\nextjs\\dist\\utils\\instrumentServer.js\r\n- C:\\Users\\\u003cusername>\\Desktop\\Dev\\\u003cworkspace-name>\\node_modules\\@sentry\\nextjs\\dist\\index.server.js\r\n- C:\\Users\\\u003cusername>\\Desktop\\Dev\\\u003cworkspace-name>\\apps\\promocodes.com\\next.config.js\r\n- C:\\Users\\\u003cusername>\\Desktop\\Dev\\\u003cworkspace-name>\\node_modules\\next\\dist\\next-server\\server\\config.js\r\n- C:\\Users\\\u003cusername>\\Desktop\\Dev\\\u003cworkspace-name>\\node_modules\\@nrwl\\next\\src\\utils\\config.js\r\n- C:\\Users\\\u003cusername>\\Desktop\\Dev\\\u003cworkspace-name>\\node_modules\\@nrwl\\next\\src\\executors\\server\\server.impl.js\r\n- C:\\Users\\\u003cusername>\\Desktop\\Dev\\\u003cworkspace-name>\\node_modules\\@nrwl\\tao\\src\\shared\\workspace.js\r\n- C:\\Users\\\u003cusername>\\Desktop\\Dev\\\u003cworkspace-name>\\node_modules\\@nrwl\\tao\\src\\commands\\run.js\r\n- C:\\Users\\\u003cusername>\\Desktop\\Dev\\\u003cworkspace-name>\\node_modules\\@nrwl\\tao\\index.js\r\n- C:\\Users\\\u003cusername>\\Desktop\\Dev\\\u003cworkspace-name>\\node_modules\\@nrwl\\cli\\lib\\run-cli.js\r\n```\r\n\r\nNote: I have also tried providing this environment variable in the next.config.js, it still defaults to loading the .env.local file, which gets overwritten on every serve or build command execution.\r\n\r\n## Proposed Solution\r\n\r\nI confirmed if I run a production server after removing the double back directories from `.env.local` file, the SDK boots up correctly and is initialized. So I could probably get around this in the CI pipeline by monkey patching the file, or just adding a DefinePlugin for that env variable to the nextjs webpack config, but that would not be a very good solution. As for my proposed solution, there should be an option to define `SENTRY_SERVER_INIT_PATH` with it defaulting to self-overwriting `.env.local` as the `@sentry/nextjs` config does at the moment.\r\n","author":{"url":"https://github.com/Saegusae","@type":"Person","name":"Saegusae"},"datePublished":"2021-06-21T22:35:09Z","url":"https://github.com/getsentry/sentry-javascript/issues/3723"}

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:7d08f269-09a9-ce66-4c81-3129b29326b8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9DD6:176400:105A44D:16DDB58:6B0449D1
html-safe-nonceac719b1f9966da6f4a4fb92d6c1568895ebb78c0ce0c94674e4deea65fec1a78
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5REQ2OjE3NjQwMDoxMDVBNDREOjE2RERCNTg6NkIwNDQ5RDEiLCJ2aXNpdG9yX2lkIjoiNTE0NDAyNzM3ODEwODA5MDgzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7b0a71deff2343720e76a962061022ec26de2aa221d4b37559f2ca2e802e6c6c
hovercard-subject-tagissue:926661560
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/3723/issue_layout
twitter:imagehttps://opengraph.githubassets.com/39256cd0bc7fe5afa24155d5fe550cf164bc160deb970f4acb2d06ddca4602ea/getsentry/sentry-javascript/issues/3723
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/39256cd0bc7fe5afa24155d5fe550cf164bc160deb970f4acb2d06ddca4602ea/getsentry/sentry-javascript/issues/3723
og:image:altReview the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSaegusae
hostnamegithub.com
expected-hostnamegithub.com
Noned4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46
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
release9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/3723#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F3723
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%2F3723
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/3723
Reloadhttps://github.com/getsentry/sentry-javascript/issues/3723
Reloadhttps://github.com/getsentry/sentry-javascript/issues/3723
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues340 (340)https://github.com/getsentry/sentry-javascript/issues
Pull requests55 (55)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/3723
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/3723
#3786https://github.com/getsentry/sentry-javascript/pull/3786
Custom path options for SENTRY_SERVER_INIT_PATH to use in monorepo environments.https://github.com/getsentry/sentry-javascript/issues/3723#top
#3786https://github.com/getsentry/sentry-javascript/pull/3786
Type: Improvementhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Type%3A%20Improvement%22
https://github.com/Saegusae
Saegusaehttps://github.com/Saegusae
on Jun 21, 2021https://github.com/getsentry/sentry-javascript/issues/3723#issue-926661560
https://docs.sentry.io/https://docs.sentry.io/
https://github.com/getsentry/sentry-javascript/issueshttps://github.com/getsentry/sentry-javascript/issues
https://github.com/getsentry/sentry-javascript/releaseshttps://github.com/getsentry/sentry-javascript/releases
@nrwl/nxhttps://nx.dev
Saegusaehttps://github.com/Saegusae
Status: Needs Triagehttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Needs%20Triage%22
on Jun 21, 2021https://github.com/getsentry/sentry-javascript/issues/3723#event-4919424810
https://github.com/shertu
shertuhttps://github.com/shertu
on Jun 23, 2021https://github.com/getsentry/sentry-javascript/issues/3723#issuecomment-866543630
https://user-images.githubusercontent.com/7973587/123041636-eb8bd900-d438-11eb-8b10-5e527a672bb0.png
https://github.com/Saegusae
Saegusaehttps://github.com/Saegusae
on Jun 23, 2021https://github.com/getsentry/sentry-javascript/issues/3723#issuecomment-867051215
https://github.com/tmilewski
tmilewskihttps://github.com/tmilewski
on Jun 27, 2021https://github.com/getsentry/sentry-javascript/issues/3723#issuecomment-869235653
https://github.com/tmilewski
tmilewskihttps://github.com/tmilewski
on Jun 27, 2021https://github.com/getsentry/sentry-javascript/issues/3723#issuecomment-869240546
@Saegusaehttps://github.com/Saegusae
https://github.com/Saegusae
Saegusaehttps://github.com/Saegusae
on Jun 29, 2021https://github.com/getsentry/sentry-javascript/issues/3723#issuecomment-870662975
@Saegusaehttps://github.com/Saegusae
@tmilewskihttps://github.com/tmilewski
https://github.com/lobsterkatie
lobsterkatiehttps://github.com/lobsterkatie
on Jul 12, 2021https://github.com/getsentry/sentry-javascript/issues/3723#issuecomment-878297232
@tmilewskihttps://github.com/tmilewski
@Saegusaehttps://github.com/Saegusae
@shertuhttps://github.com/shertu
switched our approachhttps://github.com/getsentry/sentry-javascript/pull/3786
lobsterkatiehttps://github.com/lobsterkatie
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 12, 2021https://github.com/getsentry/sentry-javascript/issues/3723#event-5007696361
lobsterkatiehttps://github.com/lobsterkatie
Status: Fixedhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Fixed%22
Package: nextjshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Package%3A%20nextjs%22
Status: Untriagedhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Untriaged%22
on Jul 12, 2021https://github.com/getsentry/sentry-javascript/issues/3723#event-5007697001
lobsterkatiehttps://github.com/lobsterkatie
Type: Improvementhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Type%3A%20Improvement%22
on Jul 22, 2021https://github.com/getsentry/sentry-javascript/issues/3723#event-5053403356
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/3723
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/3723
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.