-
Notifications
You must be signed in to change notification settings - Fork 27.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[appDir edge runtime] edgeFunctionEntry.wasm entries have incorrect filePath #41673
Closed
1 task done
Labels
bug
Issue was opened via the bug report template.
Comments
11 tasks
Opened a PR with the mentioned patch here: #41689 |
App directory is being actively worked on. We don't expect issue reports yet, but we will soon give an update on the status. Thanks! |
kodiakhq bot
pushed a commit
that referenced
this issue
Nov 3, 2022
) Fixes #41673 Updates the wasm `AssetBinding` filePath to be the fully qualified path during build so the files can get loaded. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: