-
Notifications
You must be signed in to change notification settings - Fork 501
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
Vercel WASM deployment issues #1175
Comments
Still struggling with this one. It seems vercel needs the asset path to be statically analyzable. But even with this code: const wasmPath = _dirname + '/../assets/core.wasm'; it still can't reference it, but I see the hashed file in the output tab at |
Related blog post: https://www.themosaad.com/blog/loading-static-file-remix-vercel |
As an update, this seemesly has nothing to do with ESM/CJS or even the fact that it's a wasm file as I can't even get it to work with an SVG and the instructions here. I just need to know how do I get vercel to include a file in the built function? |
I tried that - same issue - vercel doesn't know to bundle it with the function. If I understand the issue, putting it in the public / assets folder makes it a vercel CDN asset, and its not available in the function environment. |
no, u should be able to access any files public. www.url.com/wasm/test.wasm |
Oh an external URL - might be worth trying. I did just have some progress with copying files on build, which gives me an idea - working on confirming it works.. |
I have the file being moved into the function now manually post-build. Kind of silly because it copies a 23mb wasm file into EVERY serverless function, but that seems to now make it available. Thanks to: https://twitter.com/dimfeld/status/1714684628802699436 code: https://github.com/dimfeld/website/blob/master/copy_content_to_build_destination.mjs |
With a bit of extra work you can figure out the exact function you need, by looking at {
"version": 3,
"routes": [
// Removed a bunch of other routes for brevity.
{
"src": "^/notes/([^/]+?)\\.og-image\\.png/?(?:/__data.json)?$",
"dest": "/fn-0"
},
{
"src": "^/plas/event/?(?:/__data.json)?$",
"dest": "/fn-1"
},
{
"src": "^/plas/script\\.js/?(?:/__data.json)?$",
"dest": "/fn-1"
},
{
"src": "^/repl/([^/]+?)\\.json/?(?:/__data.json)?$",
"dest": "/fn-0"
},
{
"src": "^/writing/([^/]+?)\\.og-image\\.png/?(?:/__data.json)?$",
"dest": "/fn-0"
}
]
} |
Thanks again @dimfeld - your fix was the ticket! |
I am using a
@ffmpeg.wasm/main
to concatenate the audio files before sending off for transcription.It uses a .wasm file that when built, isn't being included in the vercel function.
I've tried the following code:
And that successfully includes the file in the vercel output. but this error persists:
The file is confirmed at that path (in the vercel output), but the function is unable to access it at runtime.
Not sure how to force it to include that file in the function. Any ideas?
Related:
sveltejs/kit#10594
sveltejs/kit#8441
The text was updated successfully, but these errors were encountered: