DEV Community 👩‍💻👨‍💻

Discussion on: Generate and run WebAssembly code using Go

Collapse
 
iob profile image
Yiannis • Edited on

i run your code and i had some issues as it shows here dev-to-uploads.s3.amazonaws.com/up.... seems like the instance does not export the functions or something. Can you help?

Collapse
 
iob profile image
Yiannis

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

Collapse
 
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.