-
Notifications
You must be signed in to change notification settings - Fork 268
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
Regression (0.19.3 -> 0.20.0): trunk does not initialize wasm unless a rust asset is used #791
Comments
I tried to reproduce it, but I can't. It works for me either way (asset or not). It would be good if you could share a reproducer. |
Okay, I'll prepare a minimal repro and post it later on the day 👌🏼 |
That was quicker than expected. I also noticed that 0.20.0 no longer is generating the autoreload script (or at least I don't see it)🤔. In any case, autoreload doesn't seem to be working for me in 0.20.0. I can see trunk rebuilding the code, and if I refresh the page I can see that it changed, but it doesn't automatically reload. Not sure if defaults changed or what, but otherwise that's also a bug 😅 |
Ok, that was easy. You're missing a body tag. That content is appended at the end of the That's probably due to the switch from I guess we should either warn or inject a body that if none was found. |
Ah, dammit. Yep, adding an empty body fixes it for me too. Well, in that case, I would say I prefer an error, rather than tags being created magically. Or maybe making using a rust asset mandatory would also work I guess. It's more explicit so you see what is happening. And you get to specify wasm-opt options, etc. 🤔 Do as you see fit though. Thank you for taking a look! |
If there's neither a body element, nor a link rel="rust" element, then there's no way to guess a location for inserting the wasm initializer. Instead of silently ignoring, or adding a body element ourselves, we raise this as an error. Closes #791
It's released as |
I realized that after upgrading from trunk 0.19.3 to 0.20.0 my site would not start. The background would load, but nothing would happen. I saw a suspicious warning the dev console from Firefox saying
After digging a bit, I think I found the cause. Trunk 0.19.3 generated the following at the end of
index.html
:However, trunk 0.20.0 does not generate the equivalent code unless you use a rust asset, despite the guide stating that
I'm guessing this is due to the recent addition of the custom initializer, something probably got missed. If the intention was to make using a rust asset mandatory, the documentation is now wrong, and I would expect to have some kind of error/warning message.
Also I just noticed the guide doesn't mention the
data-initializer
option, this probably needs a little updateThe text was updated successfully, but these errors were encountered: