-
Notifications
You must be signed in to change notification settings - Fork 79
Closed
Description
I'm trying to work through the "Creating Components" > "JavaScript" section. Under the Exporting WIT Interfaces with jco section, I'm finding that the string-reverse example isn't working.
Steps to reproduce:
- Created a
wit/component.witfile as instructed, except that I had to edit it to fix a syntax error (missing semicolon after thepackagedeclaration). - Created a
string-reverse.mjsfile as instructed. - Ran the
npx jco componentizecommand as instructed; note that I had to change--disable allto--disable=all. - Ran the
npx jco transpilecommand as instructed. - Added a
package.jsonfile that looks like:
-
(This step isn't in the docs, but if it's omitted, I get an error about modules when running the next step.)
{ "name": "string-reverse", "description": "Simple codebase for compiling a string reversing interface to WebAssembly with jco", "type": "module" }
- Saved the next bit of code (beginning with
import { reverse }torun.js. node run.js
Result:
wasm://wasm/02a47f8a:1
RuntimeError: unreachable
at wasm://wasm/02a47f8a:wasm-function[3]:0x971c
at wasm://wasm/02a47f8a:wasm-function[4342]:0x1b4560
at example:string-reverse/reverse@0.1.0#reverse-string (wasm://wasm/02a47f8a:wasm-function[13444]:0x81449e)
at Object.reverseString (file:///home/tjc/wasm-scratch/js-example/string-reverse-2/dist/transpiled/string-reverse.js:668:15)
at file:///home/tjc/wasm-scratch/js-example/string-reverse-2/run.js:4:26
Node.js v22.18.0
I'll keep trying to debug this, but I was hoping someone else might be able to try reproducing it so I know whether it's some quirk of my setup.
npx jco --version prints "1.13.2".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels