cloudflare/vinext

Build failure: WASM `?module` import not supported by Rolldown

Geschlossen

#1.351 geöffnet am 20.05.2026

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (383 Forks)github user discovery
adapter-api-e2ehelp wanted

Repository-Metriken

Stars
 (8.624 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 1T 1h) (462 gemergte PRs in 30 T)

Beschreibung

This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-05-20).

Problem

Rolldown cannot handle .wasm?module imports. This is a Cloudflare Workers-specific import convention (?module suffix tells the runtime to instantiate the WASM module). Neither Rolldown nor Vite have built-in support for this pattern.

Build failed with 1 error:
[UNLOADABLE_DEPENDENCY] Could not load src/add.wasm?module
   ╭─[ src/add.js:1:18 ]
 1 │ import wasm from "./add.wasm?module";

Next.js handles this through Webpack's experimental WASM support.

Estimated Impact

~4 test failures (build failure in all 3 Vite environments: RSC, client, SSR).

Affected Test Suites

  • test/e2e/edge-can-use-wasm-files/index.test.ts

Recommendation

  1. Reproduce first in vinext's own test suite. Add a test that imports a .wasm?module file and verify the build fails.

  2. Implement a Vite plugin for WASM module imports. Create a plugin that intercepts .wasm?module imports and handles them appropriately for the target environment. For Cloudflare Workers, the ?module import should be preserved in the output. For Node.js, it should use WebAssembly.compile() with a file read.

  3. Note: This may require upstream Rolldown support. Check if there is an existing Rolldown issue or plugin for WASM imports.

Contributor Guide