Skip to content

[Cli] Mismatch between documentation and CLI: wasm32-wasip1 vs wasm32-wasi target for plugin development #10284

@genskyff

Description

@genskyff

Description

When attempting to develop a plugin for SWC following the documentation, I encountered the following error while creating a new project:

❯ swc plugin new --target-type wasm32-wasip1 my-first-plugin
error: "wasm32-wasip1" isn't a valid value for '--target-type <TARGET_TYPE>'
        [possible values: wasm32-unknown-unknown, wasm32-wasi]

        Did you mean "wasm32-wasi"?

Additionally, the latest version of rustup cannot add wasm32-wasi as a target:

❯ rustup -V
rustup 1.28.1 (f9edccde0 2025-03-05)

❯ rustup target add wasm32-wasi
error: toolchain 'stable-x86_64-pc-windows-msvc' does not support target 'wasm32-wasi'; did you mean 'wasm32-wasip1'?

I tried using the nightly-2024-10-07 version that the SWC project uses, and was able to successfully add wasm32-wasi as a target.
However, the steps in the documentation clearly lead to errors when creating a new project. I found this related issue:

My question is: Was this an oversight when updating the documentation without simultaneously updating the command-line tool, or is this intentional for compatibility reasons until the Rust version is upgraded?

If it's the former, I would like to attempt to fix this.

SWC Version

16.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions