Comment

Comment by mayyue

Finally got this working. I was unable to get this to play well with Node or Bun but I did get the <script> approach working.

For the CORS with Vite you can just set a config like so in vite.config.ts

import { defineConfig } from "vite";

export default defineConfig({ server: { headers: { "Cross-Origin-Embedder-Policy": "require-corp", "Cross-Origin-Opener-Policy": "same-origin", }, }, });

I was then able to just use this code example with one caveat (https://github.com/wasmerio/wasmer-js?tab=readme-ov-file#use...)

I had to update the SDK import with crossorigin="anonymous"

parent mayyue 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton