-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Labels
Description
Is your feature request related to a problem?
As we know cloudflare worker supports importing .wasm, .wasm?module, .bin and .txt using ESM import syntax by default. This is very useful when we are using WebAssembly.
import Loader from "@acme/wasm";
import wasmModule from "@acme/wasm/wasm_bg.wasm?module";
// ^ this syntax is supported by nextjs edge runtime as well as workers
// import fontBuffer from "./lib/my-font.ttf.bin";
// ^ this syntax is supported by workers but not nextjs edge runtime
const instance = WebAssembly.Instance(wasmModule);
const loader = new Loader(instance, {
font: () => {
return fetch(new URL("./lib/my-font.ttf.bin", import.meta.url)).then(res => res.arrayBuffer());
// ^ this syntax is supported by nextjs edge runtime
}
});
export const runtime = "edge"This was possible to use the above code in our api routes when using next-on-pages since it used to support edge runtime.
I have been trying to migrate from next-on-pages to opennext-cloudflare because next-on-pages is no longer maintained and archived.
Without support for .wasm and .bin module, I will not be able to migrate my app.
Describe the solution you'd like
OpenNext should support provide a way to use these modules since next-on-pages used to support it.
Describe alternatives you've considered
None
@opennextjs/cloudflare version
1.11.0
Additional context
No response
Before submitting
- I have checked that there isn't already a similar feature request
- This is a single feature (not multiple features in one request)