DEV Community 👩‍💻👨‍💻

Discussion on: Generate and run WebAssembly code using Go

iob profile image

i figured out that i had to run a server after all goexec 'http.ListenAndServe(:8081, http.FileServer(http.Dir(.)))'

enbis profile image
enbis Author • Edited on

Hello Yiannis, thanks to run the code. the CORS error says that you cannot using the browser to directly point a file on your machine.
so you have two possibilities now

  1. you can run a local webserver as you properly mentioned here
  2. you can try setting the flag privacy.file_unique_origin to false on Firfox browser ( check it searching for about:config ).

tbh it's been a while since I've run this code, I'll check it out soon. in the meantime I hope these tips could help you.