-
Notifications
You must be signed in to change notification settings - Fork 334
Support uploading a pre-built WASM module #1716
Comments
Have you seen #1677 |
Ah, sweet! Didn't realize that PR will solve this too. Thanks for highlighting that, @koeninger. |
@GregBrimble since you are using the webpack type, https://github.com/cloudflare/worker-emscripten-template/blob/master/webpack.config.js#L24-L31 should fix your issue. It needs to be located at a specific path to get uploaded by wrangler. I don't think #1677 will fix that. |
#1677 does in fact support uploading pre-built wasm modules. |
how do we upload pre-built wasm modules? It's not clear from the PR and not documented anywhere... Using the API directly I can put this in the metadata.json and refer to {
"type": "wasm_module",
"name": "WASM",
"part": "wasm"
} How does one declare this in I have tried arbitrarily throwing the pre-built WASM module in folder declared {
"result": null,
"success": false,
"errors": [
{
"code": 10013,
"message": "workers.api.error.unknown"
}
],
"messages": []
} If I remove the WASM file from the above it succeeds, if I upload the same file to a non-module worker it still succeeds. Some description or an example indicating how it's supposed to work would be appreciated. |
@xortive @koeninger would either of you happen to know the answer to @sepbot 's last question? I've been scouring the web trying to figure out how (if at all?) I can use ffmpeg.wasm or ffmpeg.js in a worker It seems like it should just work by importing it like anything else? but |
In case it helps, setting |
💡 Feature request
Overview and problem statement
Right now, wrangler supports the building a WASM module as part of the build and upload process with
type = "rust"
, but does not support uploading a pre-built WASM module. I propose adding a new key to the wrangler configuration to allow developers to specify the filepath location of any modules they want to bind (similar to how they already specify thewebpack_config
location). I imagine it would work similar tokv_namespaces
.Basic example
Wrangler would simply have to locate the file, reference it in the metadata, and upload it alongside the script as a part of the PUT call to upload a new worker.
The text was updated successfully, but these errors were encountered: