trunk-rs / trunk

Build, bundle & ship your Rust WASM application to the web.

Home Page:https://trunkrs.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not able to build properly

715209 opened this issue · comments

Hi, I'm trying to deploy my project and I keep getting this error (and sometimes Import #5):

Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #6 module="wbg" function="__wbg_setInterval_e227d4d8a9d44d66" error: function import requires a callable
image

Not sure what's going on here, I'm using timers::future::IntervalStream::new(interval); from gloo-timers.
Everything is up to date, using trunk v0.19.1.

I also have to build with --no-sri, which seems to be only happening when building in release mode, or else I get the integrity error.

Failed to find a valid digest in the 'integrity' attribute for resource 'xxx' with computed SHA-384 integrity 'EisHsZkQm52iwWBJE3epgWPd9KalTlvoVYDHPJylPS6hI0iz06FZmqqGI+i4xubN'. The resource has been blocked

can you create a reproducer for that?

Just created this quickly https://github.com/715209/trunk-building-errors.

image

This one is new

image

Uncommenting test_sleep

image
trunk build --release

Am I doing something clearly wrong?

I just tried it locally with trunk serve and trunk serve --release. Both seem to work just fine.

That's very strange. I used the cargo binstall trunk version. Could it perhaps be an issue on mac os?

Just tried that too. Also using cargo binstall. Same result, works.

Thank you for checking, what would you recommend me to do now? 😅

I am not sure, because I wouldn't see why the problem would exist, but I am also not able to reproduce it. I guess need to investigate it further.

For the SRI part, it might be you'd been affected by #765 as well. As that might depend on the generated output and isn't 100% reproducible I guess. It should be fixed with trunk 0.19.2 though.

Looks like updating to 0.19.2 solved all issues! Still have no clue why the wbg module had those errors, but that is resolved as well 👍 .

Thanks for reporting back. I am not sure what exactly happened on your side, as it worked for me. Maybe it was a side of effect of the browser blocking the resource due to the SRI issue. Which definitely was an issue that was solved with 0.19.2.

I'll close this issue for now. We can re-open if necessary.