Hi , I was trying to run the peopleInSpace sample ...
# webassembly
a
Hi , I was trying to run the peopleInSpace sample with compose web wasm : https://github.com/joreilly/PeopleInSpace , It all works fine if I run
wasmJsBrowserRun
but if I run
wasmJsBrowserDistribution
and try to open the index.html locally in browser it does not work . Any help appreciated
Gives me bunch of errors if i open locally :
b
try to serve static files from the dir with any http server, e.g.
python -m http.server
a
So these html files will only work if a server serves them ? Is this a requirement from wasm side ? (completely noob in web development here so excuse me If i sound stupid 😄 )
b
there is restriction for
file://
protocol
🙌 1
a
Thanks , one last thing , When I publish the distribution folder on netlify : https://joyful-sawine-0e1c45.netlify.app/. It gives error in console . All my other sites created on wasm target work fine . The file that it says is missing is not even there in my dist folder (
PeopleInSpace.uninstantiated.mjs:1
) . Any idea how I would go about debugging this as it works fine when I do
wasmJsBrowserRun
b
what is version of kotlin there?
a
Copy code
1.9.20
b
Probably index.html outdated and
<script type="module" src="load.mjs"></script>
should be replaced with
<script type="application/javascript" src="???.js"></script>
???.js
should be replaced with proper js file name from dist folder
a
load.mjs
is the correct file name
Let me try building again and re uploading
b
we no longer load it directly in our examples, for example, look at here
cc @John O'Reilly
j
Ah, I think I updated other samples to reflect that change but not this one
🙌 1
🙏 1
@bashor in https://github.com/Kotlin/kotlin-wasm-examples/blob/main/compose-jetsnack/web/webpack.config.d/boilerplate.js you're loading
load.mjs
which in turn is trying to load
./jetsnackwasmapp.uninstantiated.mjs
which I don't see generated.....but doesn't seem to be an issue for that project for some reason.
whereas I'm getting following with what seems like same changes for peopleinspace (though I must be something differently)
Copy code
GET <http://localhost:8000/peopleinspace.uninstantiated.mjs> net::ERR_ABORTED 404 (File not found)
k, nvm, I had missed one update....does seem like
load.mjs
is redundant now (and maybe it's reference in
boilerplate.js
? Can they be removed?
@aishwaryabhishek3 that's merged now
🙌 1
also updated chip-8 and bikeshare repos to more closely align with approach used
b
load.mjs
is still needed, but we are working on making compose projects without custom loaders.
In our examples
load.mjs
was simplified recently by extracting handling WebAssembly.CompileError to the html file, look at f4f39b