Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

"Fatal: error in validating input" with rustwasm-worker-template #1474

Closed
CoolOppo opened this issue Aug 1, 2020 · 4 comments
Closed

"Fatal: error in validating input" with rustwasm-worker-template #1474

CoolOppo opened this issue Aug 1, 2020 · 4 comments

Comments

@CoolOppo
Copy link

CoolOppo commented Aug 1, 2020

🐛 Bug Report

Environment

  • operating system: Windows
  • output of rustc -V: rustc 1.45.1 (c367798cf 2020-07-26)
  • output of node -v: v14.1.0
  • output of wrangler -V: wrangler 1.10.3
  • contents of wrangler.toml: Default contents after running wrangler generate my-app https://github.com/cloudflare/rustwasm-worker-template

Steps to reproduce

  1. Run wrangler generate my-app https://github.com/cloudflare/rustwasm-worker-template
  2. (Optional to reproduce bug) Fill in account_id in wrangler.toml
  3. Run wrangler preview

What did you expect to see?

I expected to be able to preview the Hello World.

What did you see instead?

Massive error output too large to paste from wasm compilation, followed by:

Fatal: error in validating input
Error: failed to execute `wasm-opt`: exited with exit code: 1
  full command: "C:\\Users\\me\\AppData\\Local\\.wasm-pack\\wasm-opt-171374efd61df962\\wasm-opt.exe" "C:\\Users\\me\\OneDrive\\Desktop\\my-app\\pkg\\my_app_bg.wasm" "-o" "C:\\Users\\me\\OneDrive\\Desktop\\my-app\\pkg\\my_app_bg.wasm-opt.wasm" "-O"
To disable `wasm-opt`, add `wasm-opt = false` to your package metadata in your `Cargo.toml`.
Error: tried running command:
cmd /C C:\\Users\\me\\AppData\\Local\\.wrangler\\wasm-pack-0.9.1\\wasm-pack.exe build --target no-modules
exited with exit code: 1

Note that even if I put wasm-opt = false under my [package] section in Cargo.toml, wasm-opt is still run.

@ispivey
Copy link
Contributor

ispivey commented Aug 1, 2020

I ran in to this today as well. It looks like this is caused by rustwasm/wasm-pack#886 , which is explored more in WebAssembly/binaryen#3006 .

If you're just getting started, you can add this to your Cargo.toml:

[package.metadata.wasm-pack.profile.release]
wasm-opt = false

That disables running the wasm-opt optimization step, which will at least get you unblocked. Should be more news or an upstream change to unblock you by Monday.

@CoolOppo
Copy link
Author

CoolOppo commented Aug 1, 2020

Thanks for the response @ispivey, much appreciated. You're definitely right as I just installed Ubuntu in a VM and it happens there as well.

@CoolOppo
Copy link
Author

CoolOppo commented Aug 1, 2020

Just thought of something: It would be helpful if the error output said specifically to put wasm-opt = false under [package.metadata.wasm-pack.profile.release] in case an upstream error occurs in the future.

@stale
Copy link

stale bot commented Feb 2, 2021

This issue has been automatically marked as stale because it has not had recent activity in the last 180 days. It will be closed if no further activity occurs in the next week. Please feel free to comment if you'd like it to remain open, and thank you for your contributions.

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

No branches or pull requests

4 participants
@ispivey @CoolOppo @Electroid and others