Open walksanatora opened 1 year ago
same error when exporting from wasm32-wasi
nvm. but when exporting with wasm32-wasi it does complain at me Unsupported export type: 0x2
and after modifying the basic function to export the add function properly you then get met with
/usr/lib/node_modules/wasm2lua/resources/patches/decoder.js:1314
if (sectionId !== _helperWasmBytecode.default.sections.custom) throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId));
^
CompileError: Unexpected section: 0x3
at parseSection (/usr/lib/node_modules/wasm2lua/resources/patches/decoder.js:1314:76)
at Object.decode (/usr/lib/node_modules/wasm2lua/resources/patches/decoder.js:1697:25)
at Object.decode (/usr/lib/node_modules/wasm2lua/node_modules/@webassemblyjs/wasm-parser/lib/index.js:253:21)
at new wasm2lua (/usr/lib/node_modules/wasm2lua/js/index.js:104:42)
at Object.<anonymous> (/usr/lib/node_modules/wasm2lua/js/bin/wasm2lua.js:85:12)
at Module._compile (node:internal/modules/cjs/loader:1233:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
Node.js v20.5.1
@walksanatora if you want a webassembly to luau solution probably https://github.com/Rerumu/Wasynth is your best bet. although just noticed you have an issue there too, unfortunately a bit late then.
wasm2lua is still nice for everything else since they actually did the hard part supporting native lua, without luajit's ffi
.
when compiling for this target and then running wasm2lua on it you end up with