wasm-pack icon indicating copy to clipboard operation
wasm-pack copied to clipboard

Cannot Create New Wasm Pack Project

Open seanaye opened this issue 3 years ago • 17 comments

🐛 Bug description

wasm-pack --version > wasm-pack 0.11.0

wasm-pack new hello-world

>Error: expected value at line 1 column 1
>Caused by: expected value at line 1 column 1

🤔 Expected Behavior

Should create new project in current directory

👟 Steps to reproduce

I tried to update wasm-pack via cargo cargo install wasm-pack realized the install was broken, then uninstalled and re-installed via the install script cargo uninstall wasm-pack curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh This gave me the above error

🌍 Your environment

Include the relevant details of your environment. wasm-pack version: see above rustc version: rustc 1.69.0-nightly (246eae2fa 2023-02-21)

seanaye avatar Apr 01 '23 15:04 seanaye

I'm hitting the same issue. Updated wasm-pack using: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

error:

> wasm-pack new hello-world
Error: expected value at line 1 column 1
Caused by: expected value at line 1 column 1

wolkenmachine avatar Apr 03 '23 12:04 wolkenmachine

Confirm. wasm-pack v0.11.0 doesn't work, downgrading to 0.10.3 helped

unti1x avatar Apr 08 '23 00:04 unti1x

Issue confirmed: Creating new project not working on M1 Macbook.

Dueen avatar Apr 10 '23 10:04 Dueen

Related: #1245

orhun avatar Apr 12 '23 13:04 orhun

The fix doesn't work for my Macbook pro m2 any other fixes?

alikulaOwen avatar Apr 24 '23 13:04 alikulaOwen

It might have to do with a bad get request to https://crates.io/api/v1/crates/cargo-generate at Krate::new:

We require that all requests include a `User-Agent` header.  To allow us to determine the impact your bot has on our service, we ask that your user agent actually identify your bot, and not just report the HTTP client library you're using.  Including contact information will also reduce the chance that we will need to take action against your bot.

Bad:
  User-Agent: reqwest/0.9.1

Better:
  User-Agent: my_crawler

Best:
  User-Agent: my_crawler (my_crawler.com/info)
  User-Agent: my_crawler (help@my_crawler.com)

If you believe you've received this message in error, please email [email protected] and include the request id 53cdcda1-0ea7-4acd-9673-45da30071f07.

LeviticusNelson avatar May 12 '23 22:05 LeviticusNelson

It might have to do with a bad get request to https://crates.io/api/v1/crates/cargo-generate at Krate::new:

We require that all requests include a `User-Agent` header.  To allow us to determine the impact your bot has on our service, we ask that your user agent actually identify your bot, and not just report the HTTP client library you're using.  Including contact information will also reduce the chance that we will need to take action against your bot.

Bad:
  User-Agent: reqwest/0.9.1

Better:
  User-Agent: my_crawler

Best:
  User-Agent: my_crawler (my_crawler.com/info)
  User-Agent: my_crawler (help@my_crawler.com)

If you believe you've received this message in error, please email [email protected] and include the request id 53cdcda1-0ea7-4acd-9673-45da30071f07.

I added a User-Agent header and now I get this as an error:

dyld[77274]: Library not loaded: /usr/local/opt/[email protected]/lib/libssl.1.1.dylib
  Referenced from: <9670E1DF-008C-328F-B608-CDADE7311C0A> /Users/levi/.cargo/bin/cargo-generate
  Reason: tried: '/usr/local/opt/[email protected]/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/[email protected]/lib/libssl.1.1.dylib' (no such file), '/usr/local/opt/[email protected]/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/levi/wasm-pack/target/debug/build/bzip2-sys-e4c1951e741fbbdc/out/lib/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/build/openssl-sys-ec0a95688bf13e99/out/openssl-build/install/lib/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/build/zstd-sys-dbc8793556ebaa34/out/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/deps/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/libssl.1.1.dylib' (no such file), '/opt/homebrew/Cellar/rust/1.69.0/lib/rustlib/aarch64-apple-darwin/lib/libssl.1.1.dylib' (no such file), '/Users/levi/lib/libssl.1.1.dylib' (no such file), '/usr/local/lib/libssl.1.1.dylib' (no such file), '/usr/lib/libssl.1.1.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/[email protected]/1.1.1t/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/[email protected]/1.1.1t/lib/libssl.1.1.dylib' (no such file), '/opt/homebrew/Cellar/[email protected]/1.1.1t/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/levi/wasm-pack/target/debug/build/bzip2-sys-e4c1951e741fbbdc/out/lib/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/build/openssl-sys-ec0a95688bf13e99/out/openssl-build/install/lib/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/build/zstd-sys-dbc8793556ebaa34/out/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/deps/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/libssl.1.1.dylib' (no such file), '/opt/homebrew/Cellar/rust/1.69.0/lib/rustlib/aarch64-apple-darwin/lib/libssl.1.1.dylib' (no such file), '/Users/levi/lib/libssl.1.1.dylib' (no such file), '/usr/local/lib/libssl.1.1.dylib' (no such file), '/usr/lib/libssl.1.1.dylib' (no such file, not in dyld cache)
Error: failed to execute `cargo-generate`: exited with signal: 6 (SIGABRT)
  full command: "/Users/levi/.cargo/bin/cargo-generate" "--version"
Caused by: failed to execute `cargo-generate`: exited with signal: 6 (SIGABRT)
  full command: "/Users/levi/.cargo/bin/cargo-generate" "--version"

LeviticusNelson avatar May 12 '23 22:05 LeviticusNelson

It might have to do with a bad get request to https://crates.io/api/v1/crates/cargo-generate at Krate::new:

We require that all requests include a `User-Agent` header.  To allow us to determine the impact your bot has on our service, we ask that your user agent actually identify your bot, and not just report the HTTP client library you're using.  Including contact information will also reduce the chance that we will need to take action against your bot.

Bad:
  User-Agent: reqwest/0.9.1

Better:
  User-Agent: my_crawler

Best:
  User-Agent: my_crawler (my_crawler.com/info)
  User-Agent: my_crawler (help@my_crawler.com)

If you believe you've received this message in error, please email [email protected] and include the request id 53cdcda1-0ea7-4acd-9673-45da30071f07.

I added a User-Agent header and now I get this as an error:

dyld[77274]: Library not loaded: /usr/local/opt/[email protected]/lib/libssl.1.1.dylib
  Referenced from: <9670E1DF-008C-328F-B608-CDADE7311C0A> /Users/levi/.cargo/bin/cargo-generate
  Reason: tried: '/usr/local/opt/[email protected]/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/[email protected]/lib/libssl.1.1.dylib' (no such file), '/usr/local/opt/[email protected]/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/levi/wasm-pack/target/debug/build/bzip2-sys-e4c1951e741fbbdc/out/lib/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/build/openssl-sys-ec0a95688bf13e99/out/openssl-build/install/lib/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/build/zstd-sys-dbc8793556ebaa34/out/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/deps/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/libssl.1.1.dylib' (no such file), '/opt/homebrew/Cellar/rust/1.69.0/lib/rustlib/aarch64-apple-darwin/lib/libssl.1.1.dylib' (no such file), '/Users/levi/lib/libssl.1.1.dylib' (no such file), '/usr/local/lib/libssl.1.1.dylib' (no such file), '/usr/lib/libssl.1.1.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/[email protected]/1.1.1t/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/[email protected]/1.1.1t/lib/libssl.1.1.dylib' (no such file), '/opt/homebrew/Cellar/[email protected]/1.1.1t/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/levi/wasm-pack/target/debug/build/bzip2-sys-e4c1951e741fbbdc/out/lib/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/build/openssl-sys-ec0a95688bf13e99/out/openssl-build/install/lib/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/build/zstd-sys-dbc8793556ebaa34/out/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/deps/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/libssl.1.1.dylib' (no such file), '/opt/homebrew/Cellar/rust/1.69.0/lib/rustlib/aarch64-apple-darwin/lib/libssl.1.1.dylib' (no such file), '/Users/levi/lib/libssl.1.1.dylib' (no such file), '/usr/local/lib/libssl.1.1.dylib' (no such file), '/usr/lib/libssl.1.1.dylib' (no such file, not in dyld cache)
Error: failed to execute `cargo-generate`: exited with signal: 6 (SIGABRT)
  full command: "/Users/levi/.cargo/bin/cargo-generate" "--version"
Caused by: failed to execute `cargo-generate`: exited with signal: 6 (SIGABRT)
  full command: "/Users/levi/.cargo/bin/cargo-generate" "--version"

Update: I reinstalled cargo-generate -> cargo uninstall cargo-generate && cargo install cargo-generate and it works fine now. Still needed USER-AGENT, so I can create a PR

LeviticusNelson avatar May 12 '23 22:05 LeviticusNelson

Hmm, I haven't seen this issue myself... Does it work fine in 0.11.1?

drager avatar May 14 '23 10:05 drager

@drager When I added the header for 0.11.1, it worked, but was giving me errors when there was no USER-AGENT header.

LeviticusNelson avatar May 15 '23 20:05 LeviticusNelson

I've just tested it on 0.11.1, and I get

$ wasm-pack new hello-wasm
Error: expected value at line 1 column 1
Caused by: expected value at line 1 column 1

version

$ wasm-pack --version
wasm-pack 0.11.1

cc: @orhun since he said 0.11.1 fixes it in https://github.com/rustwasm/wasm-pack/issues/1245#issuecomment-1546147124:

This is magically fixed in 0.11.1, maybe it was related to https://github.com/rustwasm/wasm-pack/pull/1254

uxduck avatar May 28 '23 19:05 uxduck

Yeah, it is still a mystery to me how it stopped working and start working again. Somebody need to dive deeper into this.

orhun avatar May 28 '23 20:05 orhun

I just merged #1285. Please try out latest master and see if that works for you @ben-xD @orhun

drager avatar May 29 '23 18:05 drager

It's working on master, thanks @drager 🙏

uxduck avatar May 29 '23 20:05 uxduck

Could releasing this fix be prioritised, if only as a patch release on top of the previous release without any other recent additions? Older wasm-pack versions raise a warning if an older version is used so at present we're just funnelling users into a completely broken state.

clbarnes avatar Jun 09 '23 14:06 clbarnes

Could releasing this fix be prioritised, if only as a patch release on top of the previous release without any other recent additions? Older wasm-pack versions raise a warning if an older version is used so at present we're just funnelling users into a completely broken state.

Released in v0.12.0

  • https://github.com/rustwasm/wasm-pack/releases/tag/v0.12.0
  • https://crates.io/crates/wasm-pack/0.12.0
  • https://www.npmjs.com/package/wasm-pack/v/0.12.0

drager avatar Jun 17 '23 13:06 drager

It might have to do with a bad get request to https://crates.io/api/v1/crates/cargo-generate at Krate::new:

We require that all requests include a `User-Agent` header.  To allow us to determine the impact your bot has on our service, we ask that your user agent actually identify your bot, and not just report the HTTP client library you're using.  Including contact information will also reduce the chance that we will need to take action against your bot.

Bad:
  User-Agent: reqwest/0.9.1

Better:
  User-Agent: my_crawler

Best:
  User-Agent: my_crawler (my_crawler.com/info)
  User-Agent: my_crawler (help@my_crawler.com)

If you believe you've received this message in error, please email [email protected] and include the request id 53cdcda1-0ea7-4acd-9673-45da30071f07.

I added a User-Agent header and now I get this as an error:

dyld[77274]: Library not loaded: /usr/local/opt/[email protected]/lib/libssl.1.1.dylib
  Referenced from: <9670E1DF-008C-328F-B608-CDADE7311C0A> /Users/levi/.cargo/bin/cargo-generate
  Reason: tried: '/usr/local/opt/[email protected]/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/[email protected]/lib/libssl.1.1.dylib' (no such file), '/usr/local/opt/[email protected]/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/levi/wasm-pack/target/debug/build/bzip2-sys-e4c1951e741fbbdc/out/lib/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/build/openssl-sys-ec0a95688bf13e99/out/openssl-build/install/lib/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/build/zstd-sys-dbc8793556ebaa34/out/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/deps/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/libssl.1.1.dylib' (no such file), '/opt/homebrew/Cellar/rust/1.69.0/lib/rustlib/aarch64-apple-darwin/lib/libssl.1.1.dylib' (no such file), '/Users/levi/lib/libssl.1.1.dylib' (no such file), '/usr/local/lib/libssl.1.1.dylib' (no such file), '/usr/lib/libssl.1.1.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/[email protected]/1.1.1t/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/[email protected]/1.1.1t/lib/libssl.1.1.dylib' (no such file), '/opt/homebrew/Cellar/[email protected]/1.1.1t/lib/libssl.1.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/levi/wasm-pack/target/debug/build/bzip2-sys-e4c1951e741fbbdc/out/lib/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/build/openssl-sys-ec0a95688bf13e99/out/openssl-build/install/lib/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/build/zstd-sys-dbc8793556ebaa34/out/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/deps/libssl.1.1.dylib' (no such file), '/Users/levi/wasm-pack/target/debug/libssl.1.1.dylib' (no such file), '/opt/homebrew/Cellar/rust/1.69.0/lib/rustlib/aarch64-apple-darwin/lib/libssl.1.1.dylib' (no such file), '/Users/levi/lib/libssl.1.1.dylib' (no such file), '/usr/local/lib/libssl.1.1.dylib' (no such file), '/usr/lib/libssl.1.1.dylib' (no such file, not in dyld cache)
Error: failed to execute `cargo-generate`: exited with signal: 6 (SIGABRT)
  full command: "/Users/levi/.cargo/bin/cargo-generate" "--version"
Caused by: failed to execute `cargo-generate`: exited with signal: 6 (SIGABRT)
  full command: "/Users/levi/.cargo/bin/cargo-generate" "--version"

Update: I reinstalled cargo-generate -> cargo uninstall cargo-generate && cargo install cargo-generate and it works fine now. Still needed USER-AGENT, so I can create a PR

I had this same issue and running cargo uninstall cargo-generate && cargo install cargo-generate fixed the issue for me as well.

ddimaria avatar Nov 10 '24 15:11 ddimaria