Skip to content

Commit 4c28d10

Browse files
authored
chore: use a Uint8Array for the wasm
1 parent 8635ff7 commit 4c28d10

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/build/functions/edge.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ const writeHandlerFile = async (ctx: PluginContext, { matchers, name }: NextDefi
8585
JSON.stringify(minimalNextConfig),
8686
)
8787

88-
const htmlRewriterWasm = await readFile(
88+
let htmlRewriterWasm = await readFile(
8989
join(
9090
ctx.pluginDir,
9191
'edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/pkg/htmlrewriter_bg.wasm',
9292
),
9393
)
94+
htmlRewriterWasm = new Uint8Array(htmlRewriterWasm.buffer, htmlRewriterWasm.byteOffset, htmlRewriterWasm.length);
9495

9596
// Writing the function entry file. It wraps the middleware code with the
9697
// compatibility layer mentioned above.

0 commit comments

Comments
 (0)