Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message for not selecting a component should be more actionable #227

Open
lu4p opened this issue Feb 1, 2024 · 0 comments
Open

Error message for not selecting a component should be more actionable #227

lu4p opened this issue Feb 1, 2024 · 0 comments

Comments

@lu4p
Copy link

lu4p commented Feb 1, 2024

I had this .wit file:

package example:adder;

interface add {
    add: func(a: u32, b: u32) -> u32;
}

/// An example world for the component to target.
world adder {
    export add;
}

world another {
    export add;
}

I got this error, but wasn't sure what exactly it meant.

$ cargo component build --release                                                                                                                                
error: failed to create a target world for package `adder` (/home/luap/Code/add/Cargo.toml)

Caused by:
    0: failed to select the default world to use for local target `/home/luap/Code/add/wit`
    1: multiple worlds found in package `example:adder`: one must be explicitly chosen

The fix is to add a world, to [package.metadata.component] in cargo.toml in my case:

world="adder"

this should be clearly stated in the error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant