René's URL Explorer Experiment


Title: [Nuxt] Investigate issue with server-side not building correctly (`import` and `import()` are added) · Issue #14514 · getsentry/sentry-javascript · GitHub

Open Graph Title: [Nuxt] Investigate issue with server-side not building correctly (`import` and `import()` are added) · Issue #14514 · getsentry/sentry-javascript

X Title: [Nuxt] Investigate issue with server-side not building correctly (`import` and `import()` are added) · Issue #14514 · getsentry/sentry-javascript

Description: --> scroll down to see the workaround for this issue What is happening? With the Nuxt rollup plugin (which is automatically added by the SDK), the content of sentry.server.config.ts is added to the server entry file (.output/server/index...

Open Graph Description: --> scroll down to see the workaround for this issue What is happening? With the Nuxt rollup plugin (which is automatically added by the SDK), the content of sentry.server.config.ts is added to the...

X Description: --> scroll down to see the workaround for this issue What is happening? With the Nuxt rollup plugin (which is automatically added by the SDK), the content of sentry.server.config.ts is added to ...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Nuxt] Investigate issue with server-side not building correctly (`import` and `import()` are added)","articleBody":"**--> scroll down to see the workaround for this issue**\n\n# What is happening?\n\nWith the Nuxt rollup plugin (which is automatically added by the SDK), the content of `sentry.server.config.ts` is added to the server entry file (`.output/server/index.mjs`) and the rest of the server application (either `nitro/nitro.mjs` or `runtime.mjs`) is added via a dynamic `import()`.\n\nIf it is correct, it should look something like this:\n\n```js\n// CORRECT\n// Note: file may have some imports and code related to debug IDs\nSentry.init({\n  dsn: \"...\"\n});\n\nimport('./chunks/nitro/nitro.mjs').then(function (n) { return n.r; });\n\nasync function default_sentryWrapped(...args) {\n  const res = await import('./chunks/nitro/nitro.mjs').then(function (n) { return n.r; });\n  return res.default.call(this, ...args);\n}\n\nexport { default_sentryWrapped as default };\n```\n\nHowever, the build output sometimes looks like this:\n```js\n// WRONG\nimport './chunks/nitro/nitro.mjs';    // \u003c-- server file is added with `import`\n\n/* ... same code as above */\n```\n\nThis is a problem, because Sentry needs to be initialized before any other server-side code is loaded. With ES Modules, this can only happen by dynamically importing (with `import()`) the application to load it afterwards or using the `--import` flag. Sentry is not initialized correctly when there is another, regular `import` of the server-side code.\n\n# Debugging Process\n\nThe following things have been found out already:\n- the issue appears above nitropack 2.10.0 when using pnpm\n- the issue appears above nitropack 2.10.3 when using yarn\n- the issue disappears when deleting the `.git` folder (more on this below)\n- the issue disappears when deleting the contents of `server/middleware`\n- the issue disappears when commenting out [this portion](https://github.com/nitrojs/nitro/blob/8b4a408231bdc222569a32ce109796a41eac4aa6/src/rollup/config.ts#L140-L142) of `nitropack` in the `node_modules` (still needs some investigation if this happens continously)\n\n### Deleting `.git`\n\nThis is very strange, as there is no obvious connection to git. The files and folders listed below are the ones that affect the build output. If any of those are missing, the build output is correct again.\n- HEAD\n- objects (empty)\n- refs\n   - heads\n      - master\n\n# Workaround\n\nThe current workaround is overriding the version of `nitropack`. As the older version of `nitropack` is still including an old version of `@vercel/nft`, this override has to be added as well:\n\nnpm\n```json\n\"overrides\": {\n  \"nitropack\": \"~2.9.7\"\n  \"@vercel/nft\": \"^0.27.4\"\n}\n```\n\nyarn\n```json\n\"resolutions\": {\n  \"nitropack\": \"~2.9.7\"\n  \"@vercel/nft\": \"^0.27.4\"\n}\n```\n\npnpm\n```json\n\"pnpm\": {\n  \"overrides\": {\n    \"nitropack\": \"~2.9.7\"\n    \"@vercel/nft\": \"^0.27.4\"\n  }\n}\n```\n","author":{"url":"https://github.com/s1gr1d","@type":"Person","name":"s1gr1d"},"datePublished":"2024-11-27T17:08:16Z","url":"https://github.com/getsentry/sentry-javascript/issues/14514"}

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:4be70a3a-59ad-be20-cfd1-af2ba6cf71f2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB6EA:377538:800DD6:A861A3:6B04CB03
html-safe-nonce7acbe679eb4c1c74e649ee81fbea65991783d7f5b589c277edc1ad41762a30c7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNkVBOjM3NzUzODo4MDBERDY6QTg2MUEzOjZCMDRDQjAzIiwidmlzaXRvcl9pZCI6IjM4NDI3NjAxODEyOTM1NjY3MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd4a94f74809eff662b6bef616d35c265fccd7cf2a3930df8f560c5e417184d4d
hovercard-subject-tagissue:2699240817
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/14514/issue_layout
twitter:imagehttps://opengraph.githubassets.com/11aa1e81589d55fcc8ec27842381492d7f43c4d9dac319b92416c2525e345543/getsentry/sentry-javascript/issues/14514
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/11aa1e81589d55fcc8ec27842381492d7f43c4d9dac319b92416c2525e345543/getsentry/sentry-javascript/issues/14514
og:image:alt--> scroll down to see the workaround for this issue What is happening? With the Nuxt rollup plugin (which is automatically added by the SDK), the content of sentry.server.config.ts is added to the...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernames1gr1d
hostnamegithub.com
expected-hostnamegithub.com
None27ed421e5c2dac040a37529b5b9191edcc4a3de70521471e81fb4b4d9dc2aa7d
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
release63dc19014c621c67306d7899c04c78dcd0d95803
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/14514#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F14514
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%2F14514
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/14514
Reloadhttps://github.com/getsentry/sentry-javascript/issues/14514
Reloadhttps://github.com/getsentry/sentry-javascript/issues/14514
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues333 (333)https://github.com/getsentry/sentry-javascript/issues
Pull requests51 (51)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/14514
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/14514
[Nuxt] Investigate issue with server-side not building correctly (import and import() are added)https://github.com/getsentry/sentry-javascript/issues/14514#top
https://github.com/s1gr1d
https://github.com/andreiborza
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Nuxthttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Nuxt%22
https://github.com/s1gr1d
s1gr1dhttps://github.com/s1gr1d
on Nov 27, 2024https://github.com/getsentry/sentry-javascript/issues/14514#issue-2699240817
this portionhttps://github.com/nitrojs/nitro/blob/8b4a408231bdc222569a32ce109796a41eac4aa6/src/rollup/config.ts#L140-L142
s1gr1dhttps://github.com/s1gr1d
on Nov 27, 2024https://github.com/getsentry/sentry-javascript/issues/14514#event-15455624900
s1gr1dhttps://github.com/s1gr1d
s1gr1dhttps://github.com/s1gr1d
andreiborzahttps://github.com/andreiborza
on Nov 28, 2024https://github.com/getsentry/sentry-javascript/issues/14514#event-15467029496
andreiborzahttps://github.com/andreiborza
on Nov 28, 2024https://github.com/getsentry/sentry-javascript/issues/14514#event-15468548422
feat(nuxt): Add downgrade path to nitro 2.9.7https://github.com/getsentry/sentry-wizard/commit/7874d60d78fe39cabeb6d4ecc7c243ec8efed74f
7874d60https://github.com/getsentry/sentry-wizard/commit/7874d60d78fe39cabeb6d4ecc7c243ec8efed74f
feat(nuxt): Add downgrade path to nitro 2.9.7 (#725)https://github.com/getsentry/sentry-wizard/commit/6ac7776b48db1c7e546008dd671de02998c543f2
#725https://github.com/getsentry/sentry-wizard/pull/725
6ac7776https://github.com/getsentry/sentry-wizard/commit/6ac7776b48db1c7e546008dd671de02998c543f2
s1gr1dhttps://github.com/s1gr1d
Package: nuxthttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Package%3A%20nuxt%22
on Jan 8, 2025https://github.com/getsentry/sentry-javascript/issues/14514#event-15855329438
getsentry/sentry-javascripthttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22getsentry%2Fsentry-javascript%22
on Apr 7, 2025https://github.com/getsentry/sentry-javascript/issues/14514#event-17159540677
linearhttps://github.com/apps/linear
SDKs (New)https://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22SDKs%20(New)%22
Taskhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Task%22
on Apr 7, 2025https://github.com/getsentry/sentry-javascript/issues/14514#event-17159541832
stephanie-andersonhttps://github.com/stephanie-anderson
SDKs (New)https://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22SDKs%20(New)%22
getsentry/sentry-javascripthttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22getsentry%2Fsentry-javascript%22
on Apr 8, 2025https://github.com/getsentry/sentry-javascript/issues/14514#event-17167303582
mydeahttps://github.com/mydea
Taskhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Task%22
on Apr 14, 2025https://github.com/getsentry/sentry-javascript/issues/14514#event-17250191700
stephanie-andersonhttps://github.com/stephanie-anderson
Nuxthttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Nuxt%22
Package: nuxthttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Package%3A%20nuxt%22
on Apr 16, 2025https://github.com/getsentry/sentry-javascript/issues/14514#event-17295890565
stephanie-andersonhttps://github.com/stephanie-anderson
Taskhttps://github.com/getsentry/sentry-javascript/issues?q=type:"Task"
on Aug 12, 2025https://github.com/getsentry/sentry-javascript/issues/14514#event-19106362340
stephanie-andersonhttps://github.com/stephanie-anderson
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Mar 24, 2026https://github.com/getsentry/sentry-javascript/issues/14514#event-23841253230
https://github.com/s1gr1d
s1gr1dhttps://github.com/s1gr1d
on Sep 11, 2026https://github.com/getsentry/sentry-javascript/issues/14514#issuecomment-5631574638
feat(nuxt)!: Bundle server config into Nitro build #24094https://github.com/getsentry/sentry-javascript/pull/24094
s1gr1dhttps://github.com/s1gr1d
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 11, 2026https://github.com/getsentry/sentry-javascript/issues/14514#event-30958621365
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/14514
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/14514
andreiborzahttps://github.com/andreiborza
s1gr1dhttps://github.com/s1gr1d
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Nuxthttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Nuxt%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.