-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange behavior on first run of wasm-pack init
#303
Comments
hi @TejasQ - thank you for the thoughtful report, and so sorry you are running into this! due the unpredictable nature of the bug, i'll do my best to figure this out as soon as possible for ya, though it may take a bit to track down. since it's only happening some of the time, i imagine there is a race condition... somewhere? is there any chance you could point me to the source code? or share a bit of it? would love to get this fixed for you and the source would def make it easier for me :) |
Oh, the source code is just a reproduction of the README for a demo I'm doing at an event to get people fired up about this project. Here's the code. I could even push up a repo if it helps. I'll do that shortly. extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern {
fn alert(message: &str);
}
#[wasm_bindgen]
pub fn say_hello() {
alert("Hello from wasm");
} |
Thanks so much for your willingness to help, Ashley! 🎉 |
hey @TejasQ thanks for the materials- i wasn't able to recreate the bug. one thing i can note- it looks like the binary created in your error case was called
however, the name in your Cargo.toml is |
Oh no, I totally changed the name so it's more readable. |
ah! ok- so perhaps changing the name was the issue... can you try again? that may have been the culprit. if you run @alexcrichton am i right in observing that sometimes changes in |
Okay, so for context: The name of the app was I then opened this issue, and renamed the project from For that reason, I don't think changing the name was the culprit. I can try to reproduce it though, but now it's just working without breakages 🤔. I'll continue exploring and update this soon. As an aside, I just demoed this great tool and it worked, so that's pretty great. I hope more people get fired up about the incredible doors this could open. 🙂 |
@ashleygwilliams correct yeah, some metadata in I was unable to reproduce this using the repo link above too :( |
Ah, I'm sorry y'all – it is so random. Here's exactly what I do to reproduce this on a semi-consistent basis:
I also use the Thanks for trying to figure it out with me. |
testing this out- but one thing to note! you'll probably want to pass |
OK! can reproduce! here's the output i get
and here's the repo with all assets, generated included: https://github.com/ashleygwilliams/303-repro |
looks like it's a |
WOAH how'd you reproduce it? Was it following my steps? |
@TejasQ yes! though i had to change a few things in your instructions :) i think i know what the issue is (we do account for the -/_ but i guess there's a bug in it! gonna try to have a patch today) |
Thanks!
Thanks for the shorthand! So far, I've been manually making |
@TejasQ so that generally works, but you'll note that |
Hah! I really shouldn't keep doing that manually. Always trust the abstraction, as they say. Thanks for the info! |
just so you know- i haven't forgotten about this.. the issue is that i cannot figure out how to test this successfully. you are very right that it fails the first time, and then works the second! with no changes at all. this is a very interesting bug- still working on it! |
OK! 10 more minutes and i have a test that reproduces the error, #322 |
ok so this is pretty weird. first run produces what is on the left, second+ subsequent runs, what is on the right cc @alexcrichton @fitzgen you have any ideas? i am... baffled. these aren't even files that wasm-pack generates. |
@TejasQ so- i think that you may have run into this because you were running |
Yes! Why would that break things? 🤔 |
@TejasQ so the best i can tell, this is the sitch we have (i'm gonna be way way way more methodical today so that i can really nail it down...):
there's clearly some questions still here, HOWEVER, i think if you never have |
Thanks, Ashley! 🙌 While I'm happy to have a way to make it work, my inner engineer is dying to either: a) answer the questions to which we have no idea, or b) find the answer. Can I help y'all look? Can we look together? Ah, this is my favorite part about coding! |
oh i promise you i continue to dig :) a thing that would certainly help is to see if you can reproduce without a |
FOR SURE! I'll get on it and report back with anything interesting that might come up. |
it's been a second since this has been updated- do you continue to see this behavior with the latest releases? i'm going to close, but please comment/reopen if you continue to have trouble! |
🐛 Bug description
So in a new Rust project, I have my code written and sitting pretty and everything works. I am then ready to compile to wasm. I run
wasm-pack init
and get an error (described below). If I run the same command again, everything works as expected. 🤔 So weird.Error:
🤔 Expected Behavior
What should have happened?
It should have created a
pkg
folder with my npm package ready to go.👟 Steps to reproduce
Clear steps describing how to reproduce the issue, including commands and flags run. If you are seeing an error, please include the full error message and stack trace.
Unfortunately, this is completely random and hard to reproduce. :(
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: 0.4.2
rustc version: rustc 1.28.0 (9634041f0 2018-07-30)
The text was updated successfully, but these errors were encountered: