Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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"



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: