Title: Native deploy mishandles Wasm, text and data imports and package exports in framework Workers · Issue #539 · voidzero-dev/void · GitHub
Open Graph Title: Native deploy mishandles Wasm, text and data imports and package exports in framework Workers · Issue #539 · voidzero-dev/void
X Title: Native deploy mishandles Wasm, text and data imports and package exports in framework Workers · Issue #539 · voidzero-dev/void
Description: Problem void deploy --platform cloudflare bundles a framework's adapter Worker again before upload. That bundle handles two kinds of imports differently from @cloudflare/vite-plugin, so a Worker that builds with vp build can fail to depl...
Open Graph Description: Problem void deploy --platform cloudflare bundles a framework's adapter Worker again before upload. That bundle handles two kinds of imports differently from @cloudflare/vite-plugin, so a Worker th...
X Description: Problem void deploy --platform cloudflare bundles a framework's adapter Worker again before upload. That bundle handles two kinds of imports differently from @cloudflare/vite-plugin, so a Worke...
Opengraph URL: https://github.com/voidzero-dev/void/issues/539
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Native deploy mishandles Wasm, text and data imports and package exports in framework Workers","articleBody":"## Problem\n\n`void deploy --platform cloudflare` bundles a framework's adapter Worker again before upload. That bundle handles two kinds of imports differently from `@cloudflare/vite-plugin`, so a Worker that builds with `vp build` can fail to deploy or fail at runtime.\n\n**Wasm, text and data imports.** A SvelteKit Worker that imports `@resvg/resvg-wasm` fails in \"Preparing deployment\":\n\n```\nRolldown failed to resolve import \"wbg\" from \".../@resvg/resvg-wasm/index_bg.wasm\".\n```\n\n`.txt`, `.html`, `.sql` and `.bin` imports are parsed as JavaScript in the same way.\n\n**Package exports.** Dependencies resolve with browser conditions, so a package that ships both a `workerd` and a `browser` build gets the browser one. `decode-named-character-reference`, which micromark uses, then calls `document.createElement` when the module loads, and the deployed Worker fails with:\n\n```\nReferenceError: document is not defined\n```\n\n## Cause\n\n`prepareCfFrameworkBuildOutput` bundles the adapter's Worker entry with a plain Vite lib build (`prepareBundledBuildOutput`, `configFile: false`). That build has neither the Cloudflare Vite plugin's additional module rules nor Worker resolve conditions. `copyBundle` already maps `.wasm`, `.bin`, `.txt`, `.html` and `.sql` files to `wasm`, `data` and `text` modules, but the build never emits them.\n\n## Reproduction\n\nDeploy a framework app with `void deploy --platform cloudflare` whose adapter Worker either:\n\n- imports `./x.wasm`, `./x.txt` or `./x.bin`, or\n- imports a package whose `exports` list both `workerd` and `browser` builds.\n","author":{"url":"https://github.com/Pleasurecruise","@type":"Person","name":"Pleasurecruise"},"datePublished":"2026-10-21T21:59:41Z","url":"https://github.com/voidzero-dev/void/issues/539"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8f4e15d2-9eff-a889-329c-4b106045d5ff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC4C:3A0CC0:1151F5:16D1F6:6AFBAFBF |
| html-safe-nonce | 96d083dffba863c34b76629a1b9af9b5bc87bb8c329048b3da47e2554da3d01e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzRDOjNBMENDMDoxMTUxRjU6MTZEMUY2OjZBRkJBRkJGIiwidmlzaXRvcl9pZCI6Ijc1MjQ1NjQzMjE0NTM3OTI2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d47699107d19f5d59fb74e538aec16205e87faabaa863b48f17a1f32544149ce |
| hovercard-subject-tag | issue:5969223994 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/voidzero-dev/void/539/issue_layout |
| twitter:image | https://opengraph.githubassets.com/45961567bf7acae8832c2c88bd9f3ce7203432c6b5753d7302ac589f28b5a860/voidzero-dev/void/issues/539 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/45961567bf7acae8832c2c88bd9f3ce7203432c6b5753d7302ac589f28b5a860/voidzero-dev/void/issues/539 |
| og:image:alt | Problem void deploy --platform cloudflare bundles a framework's adapter Worker again before upload. That bundle handles two kinds of imports differently from @cloudflare/vite-plugin, so a Worker th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Pleasurecruise |
| hostname | github.com |
| expected-hostname | github.com |
| None | e25fbd830d3e6ad0e8935c105cf4fdc70c593dffcd27bb45b790ae4fece5ea55 |
| turbo-cache-control | no-preview |
| go-import | github.com/voidzero-dev/void git https://github.com/voidzero-dev/void.git |
| octolytics-dimension-user_id | 149750581 |
| octolytics-dimension-user_login | voidzero-dev |
| octolytics-dimension-repository_id | 1164437080 |
| octolytics-dimension-repository_nwo | voidzero-dev/void |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1164437080 |
| octolytics-dimension-repository_network_root_nwo | voidzero-dev/void |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 08c8f17f9d27054a108b8b6254e405de0151f660 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width