Skip to content

Conversation

trusktr
Copy link

@trusktr trusktr commented Sep 21, 2025

Initial addition of .js file extensions in import statements. Build not successful yet because I get this error during Rust build:

Click to expand error:
> build:wasm
> sh ./build_rust.sh

     Removed 0 files
(node:54411) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
[INFO]: 🎯  Checking for the Wasm target...
Error: wasm32-unknown-unknown target not found in sysroot: "/opt/homebrew/Cellar/rust/1.89.0_3"

Used rustc from the following path: "/opt/homebrew/bin/rustc"
It looks like Rustup is not being used. For non-Rustup setups, the wasm32-unknown-unknown target needs to be installed manually. See https://rustwasm.github.io/wasm-pack/book/prerequisites/non-rustup-setups.html on how to do this.

Caused by: wasm32-unknown-unknown target not found in sysroot: "/opt/homebrew/Cellar/rust/1.89.0_3"

Used rustc from the following path: "/opt/homebrew/bin/rustc"
It looks like Rustup is not being used. For non-Rustup setups, the wasm32-unknown-unknown target needs to be installed manually. See https://rustwasm.github.io/wasm-pack/book/prerequisites/non-rustup-setups.html on how to do this.

sed: pkg/package.json: No such file or directory
sed: pkg/package.json: No such file or directory
./build_rust.sh: line 10: cd: pkg: No such file or directory
rm: pkg/*.bak: No such file or directory
rm: pkg/.gitignore: No such file or directory

In theory this is basically ready to go, as adding .js extensions has no other effect other than updating the import statements in the output JS. So this should work well if you can build it.

I noticed this: Sunsetting the rustwasm GitHub org.

I ran into that when I clicked on the URL in the error output:

It looks like Rustup is not being used. For non-Rustup setups, the wasm32-unknown-unknown target needs to be installed manually. See https://rustwasm.github.io/wasm-pack/book/prerequisites/non-rustup-setups.html on how to do this.

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

Successfully merging this pull request may close these issues.

1 participant