Commit c64c61d8 authored by OJ Kwon's avatar OJ Kwon Committed by Jiachi Liu

fix(next-swc): correct path interop to filepath for wasm (#65633)

### What

For loading wasm, path interop to absolute file path occurs in here
(https://github.com/vercel/next.js/blob/canary/packages/next/src/build/swc/index.ts#L1249)
already so shouldn't pre-populate import path when call loading wasm to
make internal path operation
(https://github.com/vercel/next.js/blob/canary/packages/next/src/build/swc/index.ts#L1247)
work.
parent 6c661d2c
......@@ -325,7 +325,7 @@ async function tryLoadWasmWithFallback(attempts: any) {
downloadWasmPromise = downloadWasmSwc(nextVersion, wasmDirectory)
}
await downloadWasmPromise
let bindings = await loadWasm(pathToFileURL(wasmDirectory).href)
let bindings = await loadWasm(wasmDirectory)
// @ts-expect-error TODO: this event has a wrong type.
eventSwcLoadFailure({
wasm: 'fallback',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment