Skip to content

Commit 35005ef

Browse files
Add diagnostics for those who build with WASI command line ABI
1 parent ac92be3 commit 35005ef

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Runtime/src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ export class SwiftRuntime {
2727

2828
setInstance(instance: WebAssembly.Instance) {
2929
this._instance = instance;
30+
if (typeof (this.exports as any)._start === "function") {
31+
throw new Error(
32+
`JavaScriptKit supports only WASI reactor ABI.
33+
Please make sure you are building with:
34+
-Xswiftc -Xclang-linker -Xswiftc -mexec-model=reactor
35+
`
36+
);
37+
}
3038
if (this.exports.swjs_library_version() != this.version) {
3139
throw new Error(
3240
`The versions of JavaScriptKit are incompatible.

0 commit comments

Comments
 (0)