Wasm-pack: Docs mention a "build" command which doesn't exist

Created on 18 Sep 2018  路  6Comments  路  Source: rustwasm/wasm-pack

I was looking at https://rustwasm.github.io/wasm-pack/commands/index.html, which says that init has been deprecated in favor of build. Unfortunately, it seems the build command doesn't exist anymore. I wonder if these docs are entirely deprecated in favor of the wasm-rust book even :thinking:

Thanks for making wasm-pack btw! It's made compiling rust-to-wasm much easier than it was a few months ago.

bug duplicate user report

All 6 comments

@bnjbvr IIRC the build command hasn't been released yet. init is the older way of calling wasm-pack . I think the change to build will be released after Rust itself releases the 2018 edition which should be with 1.31. (This I'm less confident about but I'm pretty sure I remember hearing/reading that was the release timing)

These docs aren't deprecated they're just a little ahead of the current released version.

yup @mstallmo is right- there's another issue saying that the docs are "from the future"- this is a problem that will be solved from the next release. sorry about the trouble- we know it's a pain point and hopefully we can release soon and fix this!

Ha, I see, thanks for the answer! Is there another way to re-trigger a regular build without force-installing wasm-bindgen every time I run wasm-pack init? (I've found wasm-pack init --mode no-install, which seems to do what I want, but the long switch made me wonder if there was some shorter way to do so)

@bnjbvr as mentioned on IRC but here also for posterity- the wasm-bindgen install is the biggest pain point with this tool right now. early on we opted to force an install because wasm-bindgen has strict requirements that the CLI tool and the lib have exactly matching versions to work and folks kept bumping into issues when they didn't match. that being said, using cargo install forces not just the install but the whole compilation of the tool which, as you have noticed- takes a really long time! release 0.5.0 has a new strategy for locally installing wasm-bindgen from a binary and makes the process significantly faster. we are waiting on a PR (https://github.com/rustwasm/wasm-pack/pull/302) to complete that set of features to release 0.5.0 and with that this should be a much more pleasant sitch. that being said, a good workaround for now, if you know u have the right wasm-bindgen versions is to pass --no-installs. luckily though this should be a temporary workaround until 0.5.0. if you are curious in trying what is on master you can cargo install --git <this repo> to try out the new process (it just won't respect your lockfile, so be sure to fully specify the wasm-bidngen version in your Cargo.toml, e.g. 0.2.21 to avoid issues)

@bnjbvr thanks for posting that shortcut command. It helped me out at least :)

Fixed with the new release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marcoscaceres picture marcoscaceres  路  3Comments

Outpox picture Outpox  路  4Comments

Bernd-L picture Bernd-L  路  3Comments

tbillington picture tbillington  路  3Comments

RReverser picture RReverser  路  3Comments