René's URL Explorer Experiment


Title: sentrySvelteKit() deletes the adapter output directory (build/) on every serve-mode config load (vitest, vite dev) with @sveltejs/adapter-node 6 · Issue #25532 · getsentry/sentry-javascript · GitHub

Open Graph Title: sentrySvelteKit() deletes the adapter output directory (build/) on every serve-mode config load (vitest, vite dev) with @sveltejs/adapter-node 6 · Issue #25532 · getsentry/sentry-javascript

X Title: sentrySvelteKit() deletes the adapter output directory (build/) on every serve-mode config load (vitest, vite dev) with @sveltejs/adapter-node 6 · Issue #25532 · getsentry/sentry-javascript

Description: Outcome @sentry/sveltekit's vite plugin deletes the adapter output directory (default build/) on every vite config load in serve mode — any vitest run and any vite dev server start — when the project uses @sveltejs/adapter-node@6. Backgr...

Open Graph Description: Outcome @sentry/sveltekit's vite plugin deletes the adapter output directory (default build/) on every vite config load in serve mode — any vitest run and any vite dev server start — when the proje...

X Description: Outcome @sentry/sveltekit's vite plugin deletes the adapter output directory (default build/) on every vite config load in serve mode — any vitest run and any vite dev server start — when the p...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sentrySvelteKit() deletes the adapter output directory (build/) on every serve-mode config load (vitest, vite dev) with @sveltejs/adapter-node 6","articleBody":"### Outcome\n\n`@sentry/sveltekit`'s vite plugin deletes the adapter output directory (default `build/`) on **every vite config load in serve mode** — any `vitest` run and any `vite dev` server start — when the project uses `@sveltejs/adapter-node@6`.\n\n### Background\n\nIn a SvelteKit 3 project (vite 8 / rolldown-vite, vitest 5) whose `vite.config.ts` contains `sentrySvelteKit()` (default options) and `sveltekit({ adapter: adapter() })` from `@sveltejs/adapter-node@6.0.0`:\n\n1. `sentrySvelteKit()` always adds the `sentry-sveltekit-global-values-injection-plugin` (when `autoUploadSourceMaps` is the default `true`, regardless of `command`).\n2. That plugin's `configResolved` hook *eagerly* resolves the adapter output dir (`getAdapterOutputDir` in `packages/sveltekit/src/vite/svelteConfig.ts`).\n3. `getNodeAdapterOutputDir()` learns the directory by **executing the real adapter's `adapt()` against a stub Builder**: the stub's `writeClient(dest)` records `dest` and throws to short-circuit.\n4. `@sveltejs/adapter-node@6`'s `adapt()` begins with a direct filesystem call — `fs.rmSync(out, { force: true, recursive: true })` (`adapter-node/index.js`, first statement) — which the stub Builder cannot intercept (adapter-node 5 routed this through `builder.rimraf()`, which the stub no-ops). The real `build/` directory is deleted before the stub ever receives a call.\n\nBecause this happens in `configResolved`, it fires in serve mode too: every `vitest` run and every `vite dev` start wipes `build/`. In a `vitest`-then-`e2e` pipeline that serves the previously built output, the e2e web server dies with `Cannot find module …/build`.\n\n### Minimal reproduction\n\nAny vitest run in such a project deletes `build/`. The call path can also be proven with no vite/vitest at all:\n\n```js\n// repro.mjs — run from a SvelteKit app with @sentry/sveltekit and @sveltejs/adapter-node@6 installed\nimport { existsSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { dirname, join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport adapter from '@sveltejs/adapter-node';\n\nconst require = createRequire(import.meta.url);\nconst pkgDir = dirname(require.resolve('@sentry/sveltekit/package.json'));\nconst { getAdapterOutputDir } = await import(\n\tpathToFileURL(join(pkgDir, 'build/esm/vite/svelteConfig.js')).href // src/vite/svelteConfig.ts when built from source\n);\n\nconsole.log('build/ before:', existsSync('build')); // true (after `vite build`)\nconst out = await getAdapterOutputDir({ adapter: adapter() }, 'node');\nconsole.log('detected output dir:', out); // \"build\"\nconsole.log('build/ after:', existsSync('build')); // false — deleted\n```\n\nOutput:\n\n```\nbuild/ before: true\ndetected output dir: build\nbuild/ after: false\n```\n\n### Why the stub Builder can't help\n\nThe stub in `getNodeAdapterOutputDir` implements `writeClient`, `log`, `getBuildDirectory`, `rimraf`, `mkdirp` and `config`. adapter-node 6 does its cleanup with a direct `fs.rmSync` before it calls any Builder method, so executing `adapt()` at all is destructive, no matter how defensive the stub is.\n\n### Suggested directions\n\n- Resolve the adapter output dir lazily/only in build mode (the value feeds source-map upload and global-value injection that only matter at build time), so serve-mode config loads never execute `adapt()`.\n- Or stop executing the real adapter to learn the directory — e.g. read it from the adapter instance/config, or ask adapter authors to expose it.\n\n### Versions\n\n- `@sentry/sveltekit` 11.6.0 (`@sentry/bundler-plugins` 11.6.0)\n- `@sveltejs/kit` 3.0.1, `@sveltejs/adapter-node` 6.0.0\n- vite 8.3.4, vitest 5.0.3, Node 24.20.0 (Windows; the `fs.rmSync` is platform-independent)\n","author":{"url":"https://github.com/luksluki","@type":"Person","name":"luksluki"},"datePublished":"2026-10-19T15:14:01Z","url":"https://github.com/getsentry/sentry-javascript/issues/25532"}

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:f62fcafa-d243-b686-461f-9a3713852b93
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCE34:30B4F6:1088CCB:158DDD7:6B0532C4
html-safe-nonce1a28531ab8f1af901eac7ef9a8276ab4c424ee580fad93854ad95108aeb8aebd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRTM0OjMwQjRGNjoxMDg4Q0NCOjE1OERERDc6NkIwNTMyQzQiLCJ2aXNpdG9yX2lkIjoiNjA3NDI3NjI2ODg5NDEzOTA3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacbc5a61d17e73a9d46413602690b8f7260830062abe8bfc3f97a384ff9cb4ce85
hovercard-subject-tagissue:5926520712
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/25532/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c9b94982531fe7d2240de48b1985a8935a3b5b360160702c7179c7fa278bb585/getsentry/sentry-javascript/issues/25532
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c9b94982531fe7d2240de48b1985a8935a3b5b360160702c7179c7fa278bb585/getsentry/sentry-javascript/issues/25532
og:image:altOutcome @sentry/sveltekit's vite plugin deletes the adapter output directory (default build/) on every vite config load in serve mode — any vitest run and any vite dev server start — when the proje...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameluksluki
hostnamegithub.com
expected-hostnamegithub.com
None854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b
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
release220e980097d94ce616d5d11fbd5316d208e3fc93
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/25532#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F25532
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%2F25532
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/25532
Reloadhttps://github.com/getsentry/sentry-javascript/issues/25532
Reloadhttps://github.com/getsentry/sentry-javascript/issues/25532
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues334 (334)https://github.com/getsentry/sentry-javascript/issues
Pull requests53 (53)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/25532
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/25532
sentrySvelteKit() deletes the adapter output directory (build/) on every serve-mode config load (vitest, vite dev) with @sveltejs/adapter-node 6https://github.com/getsentry/sentry-javascript/issues/25532#top
https://github.com/s1gr1d
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
SvelteKithttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22SvelteKit%22
https://github.com/luksluki
lukslukihttps://github.com/luksluki
on Oct 19, 2026https://github.com/getsentry/sentry-javascript/issues/25532#issue-5926520712
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Oct 19, 2026https://github.com/getsentry/sentry-javascript/issues/25532#event-33657948534
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Oct 19, 2026https://github.com/getsentry/sentry-javascript/issues/25532#issuecomment-6270614407
Linear Codehttps://linear.app
JS-3961https://linear.app/getsentry/issue/JS-3961
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 19, 2026https://github.com/getsentry/sentry-javascript/issues/25532#event-33657954195
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 19, 2026https://github.com/getsentry/sentry-javascript/issues/25532
linear-codehttps://github.com/apps/linear-code
SvelteKithttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22SvelteKit%22
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Oct 19, 2026https://github.com/getsentry/sentry-javascript/issues/25532#event-33657994849
s1gr1dhttps://github.com/s1gr1d
on Oct 20, 2026https://github.com/getsentry/sentry-javascript/issues/25532#event-33736859295
https://github.com/s1gr1d
s1gr1dhttps://github.com/s1gr1d
on Oct 20, 2026https://github.com/getsentry/sentry-javascript/issues/25532#issuecomment-6290228933
#25193https://github.com/getsentry/sentry-javascript/pull/25193
#25186https://github.com/getsentry/sentry-javascript/issues/25186
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Oct 20, 2026https://github.com/getsentry/sentry-javascript/issues/25532#event-33738238001
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 20, 2026https://github.com/getsentry/sentry-javascript/issues/25532
s1gr1dhttps://github.com/s1gr1d
Waiting for: Communityhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Community%22
on Oct 20, 2026https://github.com/getsentry/sentry-javascript/issues/25532#event-33738297476
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 20, 2026https://github.com/getsentry/sentry-javascript/issues/25532
https://github.com/mydea
mydeahttps://github.com/mydea
on Oct 23, 2026https://github.com/getsentry/sentry-javascript/issues/25532#issuecomment-6359478487
#25193https://github.com/getsentry/sentry-javascript/pull/25193
#25186https://github.com/getsentry/sentry-javascript/issues/25186
mydeahttps://github.com/mydea
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 23, 2026https://github.com/getsentry/sentry-javascript/issues/25532#event-34026972683
getsantryhttps://github.com/apps/getsantry
Waiting for: Communityhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Community%22
on Oct 23, 2026https://github.com/getsentry/sentry-javascript/issues/25532#event-34026975063
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/25532
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/25532
s1gr1dhttps://github.com/s1gr1d
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
SvelteKithttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22SvelteKit%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
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.