René's URL Explorer Experiment


Title: SvelteKit deploy: the framework Worker packager resolves external packages with browser conditions, so `@sentry/sveltekit` fails to bundle · Issue #422 · voidzero-dev/void · GitHub

Open Graph Title: SvelteKit deploy: the framework Worker packager resolves external packages with browser conditions, so `@sentry/sveltekit` fails to bundle · Issue #422 · voidzero-dev/void

X Title: SvelteKit deploy: the framework Worker packager resolves external packages with browser conditions, so `@sentry/sveltekit` fails to bundle · Issue #422 · voidzero-dev/void

Description: Problem A SvelteKit + Void app imports @sentry/sveltekit (11.7.0) in src/hooks.server.ts. vp build passes. void deploy then fails at the packaging step, before anything is uploaded: ● sveltekit framework deploy ● Found 1 migration ◇ Bund...

Open Graph Description: Problem A SvelteKit + Void app imports @sentry/sveltekit (11.7.0) in src/hooks.server.ts. vp build passes. void deploy then fails at the packaging step, before anything is uploaded: ● sveltekit fra...

X Description: Problem A SvelteKit + Void app imports @sentry/sveltekit (11.7.0) in src/hooks.server.ts. vp build passes. void deploy then fails at the packaging step, before anything is uploaded: ● sveltekit fra...

Opengraph URL: https://github.com/voidzero-dev/void/issues/422

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SvelteKit deploy: the framework Worker packager resolves external packages with browser conditions, so `@sentry/sveltekit` fails to bundle","articleBody":"## Problem\n\nA SvelteKit + Void app imports `@sentry/sveltekit` (11.7.0) in `src/hooks.server.ts`. `vp build` passes. `void deploy` then fails at the packaging step, before anything is uploaded:\n\n```\n● sveltekit framework deploy\n● Found 1 migration\n◇ Bundling worker...\n■ Build failed with 1 error:\n\n  Error: [vite+]: Rolldown failed to resolve import \"$app/stores\" from\n  \"…/node_modules/@sentry/sveltekit/build/esm/client/svelte4BrowserTracing.js\".\n  This is most likely unintended because it can break your application at\n  runtime.\n  If you do want to externalize this module explicitly add it to\n  `build.rolldownOptions.external`\n```\n\nThe `void deploy --platform cloudflare` packager has the same problem and gives the same error.\n\npg/MySQL SvelteKit apps hit it too after #413, with the same error.\n\nThe same cause can also fail without any error at build time. `postgres` (3.4.9) packages fine, but the packager picks its Node build. Node's `net`/`crypto`/`stream` become an empty stub, so the first query fails in workerd:\n- `nodejs_als` (the SvelteKit preset default): `ReferenceError: Buffer is not defined`\n- `nodejs_als` + `nodejs_compat`: `TypeError: import___vite_browser_external.default.Socket is not a constructor`\n\n## Repro\n\nStart from `playground/sveltekit` (D1 + KV, `@sveltejs/adapter-cloudflare` 8, Kit 3).\n\n1. Add a dependency: `\"@sentry/sveltekit\": \"11.7.0\"`.\n2. Add `src/hooks.server.ts`:\n   ```ts\n   import * as Sentry from '@sentry/sveltekit';\n   import { sequence } from '@sveltejs/kit/hooks';\n\n   export const handle = sequence(\n     Sentry.initCloudflareSentryHandle({ dsn: 'https://public@example.invalid/1', tracesSampleRate: 1 }),\n     Sentry.sentryHandle(),\n   );\n   export const handleError = Sentry.handleErrorWithSentry();\n   ```\n3. Run:\n   ```sh\n   vp build                   # passes\n   void deploy --skip-build   # fails at \"Bundling worker...\"\n   ```\n   For the native path, call `prepareCfFrameworkBuildOutput` (`void deploy --platform cloudflare` runs it as a preflight) on the same build. It fails with the same error.\n\n## Cause\n\nKit's server build leaves `@sentry/sveltekit` as a bare import (`.svelte-kit/output/server/entries/hooks.server.js`: `import * as Sentry from \"@sentry/sveltekit\"`). Void then bundles the adapter's `_worker.js` with a Vite **lib** build. That build has no `ssr` and no `resolve.conditions`, so Vite uses its client environment, with conditions `[\"module\",\"browser\",\"development|production\"]`.\n\n```\nvp build (Kit + adapter-cloudflare)\n  └─ .svelte-kit/cloudflare/_worker.js ──> hooks.server.js ──> \"@sentry/sveltekit\" (external)\n            │\n  void deploy                                void deploy --platform cloudflare\n  runFrameworkDeploy                         prepareCfFrameworkBuildOutput\n  bundleEntry  (wrapper.ts:520)              prepareBundledBuildOutput (cf-build-output.ts:205)\n            └──── vite build({ build: { lib } }) → client env, \"browser\" condition ────┘\n                                     │\n   @sentry/sveltekit → build/esm/index.client.js → … → client/svelte4BrowserTracing.js\n                                     └─ import \"$app/stores\"  ✗ (exists only inside Kit's build)\n```\n\nCode (on `main`, b58300ff8):\n- `packages/void/src/cli/preset.ts:115-124`: the `sveltekit` preset sets `bundle: true` (`:123`). It is the only preset that does.\n- `packages/void/src/cli/deploy-managed-framework.ts:133-135`: the hosted deploy calls `bundleEntry(root, originalEntry)`.\n- `packages/void/src/cli/wrapper.ts:520-553`: `bundleEntry` runs `build({ root, build: { lib: { entry, formats: ['es'] }, … } })` and sets no conditions.\n- `packages/void/src/cli/deploy-cloudflare-build.ts:326-336`: the native deploy runs `prepareCfFrameworkBuildOutput` for every `worker-output` preset (SvelteKit, Nuxt, Analog, Astro), as a preflight before remote changes. Only SvelteKit was tested.\n- `packages/void/src/cli/cf-build-output.ts:205-229`: `prepareBundledBuildOutput` is the same kind of lib build (`configFile: false`, `lib` at `:225`).\n- `packages/void/src/plugin-framework.ts:280-321`: for pg/MySQL, the `void:sveltekit-worker-build` plugin moves only `void`, `drizzle-orm`, the driver and packages that import `void` into Kit's workerd build. \"Other dependencies stay external\" (`:287`), so they still reach the browser-condition packager.\n\n`@sentry/sveltekit@11.7.0` `package.json` → `exports[\".\"]`:\n```json\n{\n  \"types\": \"./build/types/index.types.d.ts\",\n  \"workerd\": { \"import\": \"./build/esm/index.workerd.js\", \"require\": \"./build/cjs/index.workerd.js\" },\n  \"worker\":  { \"import\": \"./build/esm/index.worker.js\",  \"require\": \"./build/cjs/index.worker.js\" },\n  \"browser\": { \"import\": \"./build/esm/index.client.js\",  \"require\": \"./build/cjs/index.client.js\" },\n  \"node\":    { \"import\": \"./build/esm/index.server.js\",  \"require\": \"./build/cjs/index.server.js\" },\n  \"default\": { \"import\": \"./build/esm/index.server.js\",  \"require\": \"./build/cjs/index.server.js\" }\n}\n```\nWith the client conditions, only `browser` matches, so the import resolves to `index.client.js`. That file is browser code: it pulls in Kit's `$app/*` modules and does not export `initCloudflareSentryHandle` or `sentryHandle`.\n\n`postgres@3.4.9` `exports[\".\"]` is `{ \"workerd\": \"./cf/src/index.js\", \"import\": \"./src/index.js\", … }`. The client conditions skip `workerd` and match `import`, which is the Node build.\n\nCheck: the same `bundleEntry` options plus only `resolve.conditions: ['workerd','worker','browser','module','import','default']`:\n- `@sentry/sveltekit` resolves to `index.workerd.js`. The build passes, and the Worker returns 200 for `/` in Miniflare with `nodejs_als`.\n- `postgres` resolves to `cf/src/index.js`. The query reaches a real socket connect.\n\n## Suggested fix\n\nGive both lib builds Worker resolve conditions. `wrapper.ts:315-316` already defines `WORKER_CONDITIONS` and uses it for the SQL driver bundle (`wrapper.ts:353-357`). Use it in `bundleEntry` and `prepareBundledBuildOutput` (`resolve: { conditions: WORKER_CONDITIONS }`). `prepareCfStaticBuildOutput` (`cf-build-output.ts:256`) shares `prepareBundledBuildOutput`, so it gets the same change. Add a regression test with a fixture package that has both `browser` and `workerd` exports, and check that the packaged Worker uses the `workerd` file.\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nhttps://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH\n","author":{"url":"https://github.com/Brooooooklyn","@type":"Person","name":"Brooooooklyn"},"datePublished":"2026-10-14T11:08:00Z","url":"https://github.com/voidzero-dev/void/issues/422"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:65ddd992-4978-0263-77ff-0c9d050d2cae
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB768:37E613:1AA82E0:2473174:6AFB974E
html-safe-nonceda201e793a3f0f24dcba7db35b6399b0823b70384c582290ea29857c0cd7d077
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzY4OjM3RTYxMzoxQUE4MkUwOjI0NzMxNzQ6NkFGQjk3NEUiLCJ2aXNpdG9yX2lkIjoiOTU3NTg0NzA1ODU3NDkyODE0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac5d5ceaa828d73f81df60117fcf96ac2bc70b97c19eb9386ef1144b53216063e1
hovercard-subject-tagissue:5846687431
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/voidzero-dev/void/422/issue_layout
twitter:imagehttps://opengraph.githubassets.com/eaa5d86afa2416f824ffc175fcd230ce72020a924eeabb99d415e80da6f45a14/voidzero-dev/void/issues/422
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/eaa5d86afa2416f824ffc175fcd230ce72020a924eeabb99d415e80da6f45a14/voidzero-dev/void/issues/422
og:image:altProblem A SvelteKit + Void app imports @sentry/sveltekit (11.7.0) in src/hooks.server.ts. vp build passes. void deploy then fails at the packaging step, before anything is uploaded: ● sveltekit fra...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameBrooooooklyn
hostnamegithub.com
expected-hostnamegithub.com
None4f01efe06174a5ba6342fd58e42d02295e0675bedbb465d6bef2dbaec8e46556
turbo-cache-controlno-preview
go-importgithub.com/voidzero-dev/void git https://github.com/voidzero-dev/void.git
octolytics-dimension-user_id149750581
octolytics-dimension-user_loginvoidzero-dev
octolytics-dimension-repository_id1164437080
octolytics-dimension-repository_nwovoidzero-dev/void
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1164437080
octolytics-dimension-repository_network_root_nwovoidzero-dev/void
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
releasea52db8866b6543b4e83730cd6a6b1360f1a9e4dc
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/voidzero-dev/void/issues/422#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvoidzero-dev%2Fvoid%2Fissues%2F422
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%2Fvoidzero-dev%2Fvoid%2Fissues%2F422
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=voidzero-dev%2Fvoid
Reloadhttps://github.com/voidzero-dev/void/issues/422
Reloadhttps://github.com/voidzero-dev/void/issues/422
Reloadhttps://github.com/voidzero-dev/void/issues/422
voidzero-devhttps://github.com/voidzero-dev
voidhttps://github.com/voidzero-dev/void
Codehttps://github.com/voidzero-dev/void
Issues31 (31)https://github.com/voidzero-dev/void/issues
Pull requests16 (16)https://github.com/voidzero-dev/void/pulls
Discussionshttps://github.com/voidzero-dev/void/discussions
Actionshttps://github.com/voidzero-dev/void/actions
Security and qualityhttps://github.com/voidzero-dev/void/security
Insightshttps://github.com/voidzero-dev/void/pulse
https://github.com/voidzero-dev/void
New issuehttps://github.com/login?return_to=https://github.com/voidzero-dev/void/issues/422
New issuehttps://github.com/login?return_to=https://github.com/voidzero-dev/void/issues/422
#592https://github.com/voidzero-dev/void/pull/592
SvelteKit deploy: the framework Worker packager resolves external packages with browser conditions, so @sentry/sveltekit fails to bundlehttps://github.com/voidzero-dev/void/issues/422#top
#592https://github.com/voidzero-dev/void/pull/592
bugSomething isn't workinghttps://github.com/voidzero-dev/void/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/Brooooooklyn
Brooooooklynhttps://github.com/Brooooooklyn
on Oct 14, 2026https://github.com/voidzero-dev/void/issues/422#issue-5846687431
#413https://github.com/voidzero-dev/void/pull/413
b58300fhttps://github.com/voidzero-dev/void/commit/b58300ff84cfdd29ae66557640903613435e872f
Claude Codehttps://claude.com/claude-code
https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufHhttps://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
Brooooooklynhttps://github.com/Brooooooklyn
bugSomething isn't workinghttps://github.com/voidzero-dev/void/issues?q=state%3Aopen%20label%3A%22bug%22
on Oct 14, 2026https://github.com/voidzero-dev/void/issues/422#event-33219372102
cpojerhttps://github.com/cpojer
completedhttps://github.com/voidzero-dev/void/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#592https://github.com/voidzero-dev/void/pull/592
on Oct 26, 2026https://github.com/voidzero-dev/void/issues/422#event-34232322137
cpojerhttps://github.com/cpojer
on Oct 26, 2026https://github.com/voidzero-dev/void/issues/422#event-34233323988
fix(deploy): resolve hosted framework bundles with Worker conditions (v…https://github.com/0froq/void-fork/commit/233a0f735c80f88a7d7f3198a2aa4007258e072e
v…https://github.com/voidzero-dev/void/pull/592
https://docs.github.com/articles/closing-issues-via-commit-messages
233a0f7https://github.com/0froq/void-fork/commit/233a0f735c80f88a7d7f3198a2aa4007258e072e
Sign up for freehttps://github.com/signup?return_to=https://github.com/voidzero-dev/void/issues/422
Sign in to commenthttps://github.com/login?return_to=https://github.com/voidzero-dev/void/issues/422
bugSomething isn't workinghttps://github.com/voidzero-dev/void/issues?q=state%3Aopen%20label%3A%22bug%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

Viewport: width=device-width


URLs of crawlers that visited me.