[appDir edge runtime] edgeFunctionEntry.wasm entries have incorrect filePath #41673
Closed
1 task done
Labels
bug
Issue was opened via the bug report template.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
When importing
.wasm
files using the edge runtime, Next's production build fails in this call togetRuntimeContext()
:next.js/packages/next/build/utils.ts
Lines 1259 to 1266 in 9c7e8b6
It appears that in the the call to
loadWasm()
, thefilePath
in the manifest does not include thedistDir
:next.js/packages/next/server/web/sandbox/context.ts
Lines 57 to 62 in 9c7e8b6
If I patch this and prepend
distDir
, the build succeeds and the file is loaded correctly at runtime. It looks like that at runtime,distDir
is added via thegetEdgeFunctionInfo()
method innext-server
before callingloadWasm()
:next.js/packages/next/server/next-server.ts
Lines 1646 to 1649 in 9c7e8b6
Expected Behavior
I would expect the build to succeed when using
wasm
files with the edge runtime. This change innext/build/utils.ts
seems to fix it, but I'm not sure if it's the root cause or just masking something else.Link to reproduction
https://github.com/BRKalow/next-app-dir-edge-wasm
To Reproduce
Run:
Observe the error.
The text was updated successfully, but these errors were encountered: