mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Fix Wasm Edge Function Docs (#33910)
* fixed docs bug: when importing wasm, you need to include the js and use this. Otherwise, there will be wasm instantiate errors * Update wasm.mdx Got rid of filename on top of markdown * Update index.ts got rid of filename comment at the top
This commit is contained in:
1 parent
342c9c4112
commit
00dfbdca0a
2 files changed
+2
-9
No files matched your search
@@ -77,7 +77,7 @@ Before deploying the Edge Function, we need to ensure it bundles the Wasm module
|
||||
|
||||
```toml
|
||||
[functions.wasm-add]
|
||||
static_files = [ "./functions/wasm-add/add-wasm/pkg/*.wasm"]
|
||||
static_files = [ "./functions/wasm-add/add-wasm/pkg/*"]
|
||||
```
|
||||
|
||||
Deploy the function by running:
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
const wasmBuffer = await Deno.readFile(
|
||||
new URL("./add-wasm/pkg/add_wasm_bg.wasm", import.meta.url),
|
||||
);
|
||||
|
||||
const { instance } = await WebAssembly.instantiate(
|
||||
wasmBuffer,
|
||||
);
|
||||
const { add } = instance.exports;
|
||||
import { add } from "./add-wasm/pkg/add_wasm.js";
|
||||
|
||||
Deno.serve(async (req) => {
|
||||
const { a, b } = await req.json();
|
||||
|
||||
Reference in new issue
Block a user