Skip to content

Jco crashes when using same interface name from different packages #998

Closed

Description

@SanderVanRiessen

I'm trying to use two different wasm components where both components exporting the same interface. When I run componentize of jco it is crashing because the bindings are using the same names.

$ jco componentize -w wit -d all -o dist/custom.wasm src/actions.js
(jco componentize) Error: Failed to initialize component:
Exception while running initialization script
/var/folders/8_/7m7fz4qd4730mbpvtmfjctlc0000gn/T/a63ab51139cd/sources/initializer.js:8:43 SyntaxError: redeclaration of let $import_http$run:
/var/folders/8_/7m7fz4qd4730mbpvtmfjctlc0000gn/T/a63ab51139cd/sources/initializer.js:8:43 let [$memory, $realloc, $import_http$run, $import_http$run] = $bindings;
/var/folders/8_/7m7fz4qd4730mbpvtmfjctlc0000gn/T/a63ab51139cd/sources/initializer.js:8:43 ..........................................^
/var/folders/8_/7m7fz4qd4730mbpvtmfjctlc0000gn/T/a63ab51139cd/sources/initializer.js:8:25 note: Previously declared at line 8, column 25
    at componentize (file:///Users/sandervanriessen/Downloads/tmp/jco-same-wit-interfaces/node_modules/@bytecodealliance/jco/node_modules/@bytecodealliance/componentize-js/src/componentize.js:352:11)
    at async componentize (file:///Users/sandervanriessen/Downloads/tmp/jco-same-wit-interfaces/node_modules/@bytecodealliance/jco/src/cmd/componentize.js:20:24)
    at async file:///Users/sandervanriessen/Downloads/tmp/jco-same-wit-interfaces/node_modules/@bytecodealliance/jco/src/jco.js:467:17

I have created a public repo which can be cloned to reproduce the issue

Activity

  1. vados-cosmonic commented on Sep 2, 2025

    @vados-cosmonic
    Collaborator

    Hey @SanderVanRiessen thanks for filing this -- I'll take a look at this soon, hopefully sometime this week!

  2. SanderVanRiessen commented on Oct 13, 2025

    @SanderVanRiessen
    Author

    Hi @vados-cosmonic, I looked into this issue and fixed it in the componetizejs repo. Here is the PR: bytecodealliance/ComponentizeJS#306

  3. vados-cosmonic commented on Oct 14, 2025

    @vados-cosmonic
    Collaborator

    That's awesome, thanks @SanderVanRiessen ! Going to take a look at it now

  4. vados-cosmonic commented on Oct 27, 2025

    @vados-cosmonic
    Collaborator

    OK, so the upstream PR has merged and been released in componentize-js 0.19.3 which should be integrated into jco... I think we can close this once the release of the next version of Jco is out.

  5. vados-cosmonic commented on Oct 27, 2025

    @vados-cosmonic
    Collaborator

    Closing this as the next version of jco will be out soon.

    @SanderVanRiessen If you wouldn't mind trying jco v1.15.2 and making sure the bug is gone for you when you get a chance that'd be great. We can re-open this if the bug is somehow still present!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions