old-docs.wasmer.io
old-docs.wasmer.io copied to clipboard
Fixes needed in js/wasi/hello-world example
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 devthe 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 buildtarget to be able to host the static files.
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 +.
Also since the example suggests using parcel, I'm not sure if parcel v2 still works with it the same way.
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