old-docs.wasmer.io icon indicating copy to clipboard operation
old-docs.wasmer.io copied to clipboard

Fixes needed in js/wasi/hello-world example

Open fritzbauer opened this issue 4 years ago • 3 comments

I was facing the following issues when using the hello-world example:

  • The index.html is not loading correctly in chrome, because type="module" is not specified in the
  • When instantiating the WASI object no preopens are specified. This is working fine for the hello-world example, but when trying to do any additional File IO errors will occur. I am not sure if I overlooked some obvious documentation for this parameter, but it would've helped me a lot if something like preopens: { '/': '/' } could be included in the example.
  • When running npm run dev the helloworld.wasm cannot be loaded, because it is not copied from the static directory to the dist directory and parcel does not serve it from the static directory
  • It would be great to have a working npm run build target to be able to host the static files.

fritzbauer avatar Oct 19 '21 13:10 fritzbauer

Hi, I was excited to try out the example too, but unfortunately also couldn't get the example to work. The example specifies code that uses wasi.getImports() which I believe has been removed, so probably the example needs to be updated for version 1.x +.

ChristophP avatar Jul 10 '22 15:07 ChristophP

Also since the example suggests using parcel, I'm not sure if parcel v2 still works with it the same way.

ChristophP avatar Jul 10 '22 15:07 ChristophP

the example also uses a version from years ago (0.10.0 vs today's 1.2.2), and the API has changed since then

DougAnderson444 avatar May 15 '23 17:05 DougAnderson444