sdeleuze
06/30/2024, 2:01 PMcd samples/web-server-sample
./run.sh
file:///Users/sdeleuze/workspace/kowasm/samples/web-server-sample/build/compileSync/wasmJs/main/productionExecutable/kotlin/kowasm-samples-web-server-sample-wasm-js.uninstantiated.mjs:112
'org.nodejs.http.createServer_$external_fun' : (p0) => _ref_aHR0cA_.createServer(p0),
^
TypeError: Cannot read properties of undefined (reading 'createServer')
The related JS API does not seems to have change, I can also reproduce with the old NodeJS version I was using, so I tend to think it could be a change of behavior after upgrading from Kotlin 1.9.10
to 2.0.0
. Everything is pushed, so it should be easy to reproduce. Is it a Kotlin 2.0.0 regression or something I should refine on my side?Svyatoslav Kuzmich [JB]
06/30/2024, 2:27 PMuninstantiated.mjs
now needs all the imports to be passed explicitly:
-const { exports, instance } = await instantiate({ wasi_snapshot_preview1 : wasi.wasiImport }, false);
+import * as net from "net";
+import * as http from "http";
+const { exports, instance } = await instantiate({ wasi_snapshot_preview1 : wasi.wasiImport, net, http }, false);
sdeleuze
06/30/2024, 2:30 PMSvyatoslav Kuzmich [JB]
06/30/2024, 2:31 PMsdeleuze
06/30/2024, 4:21 PMwasmWasi
shortly.