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

Trunk Build fails at 'downloading wasm-bindgen'

deanchalk opened this issue · comments

When I run 'cargo build' on my WASM project, everything works fine. When I run 'trunk build' it crashes whilst acquiring wasm-bindgen

//....
2023-09-05T12:13:39.258049Z INFO downloading wasm-bindgen version="0.2.87"
2023-09-05T12:13:39.768444Z ERROR error
error from HTML pipeline

Caused by:
0: error from asset pipeline
1: failed downloading release archive
2: error sending HTTP request
3: error sending request for url (https://objects.githubusercontent.com/github-production-release-asset-2e65be/114685405/b7bc6c0c-04bc-4ee6-9f3a-abbaf3f53ee9?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230905%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230905T121339Z&X-Amz-Expires=300&X-Amz-Signature=67f8165ddd327b9d483677b3c0d640fd0e1c9ef710e595d21522e696f7b7498d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=114685405&response-content-disposition=attachment%3B%20filename%3Dwasm-bindgen-0.2.87-x86_64-pc-windows-msvc.tar.gz&response-content-type=application%2Foctet-stream): error trying to connect: invalid peer certificate: UnknownIssuer
4: error trying to connect: invalid peer certificate: UnknownIssuer
5: invalid peer certificate: UnknownIssuer
//.....

The only thing that seems wrong is that the download url begins with https://objects.githubusercontent.com - and the SSL certificate is invalid.

Does anyone else have any ideas?

commented

are you on mac?

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

This issue was closed because it has been stalled for 5 days with no activity.

Can this be reopened? I have the same issue. I am on windows. The cause is probably that I am behind a corporate proxy which replaces the certificate chain. I had to set cargo's cainfo variable to a custom created pem file, but this setting does not seem to be respected by trunk's build command.

This is still not working. As #596 mentioned, using rustls-tls-native-roots should solve the issue. Hope this can be implemented...

This is still not working. As #596 mentioned, using rustls-tls-native-roots should solve the issue. Hope this can be implemented...

Can you try the version on master? This was merged yesterday .

Isn't that what PR #615 addressed?

If that works, I can push out a release tomorrow.

Isn't that what PR #615 addressed?

I got the same error. There can be a lot of causes though, but it fixed my error. I don't even think the switches are needed in my scenario when using the native cert store.

I'll close this one until there's some more input on what can be fixed. I think having the ability to use a custom trust anchor is fine. One alternative is to fetch tools upfront, so that trunk doesn't need to fetch them.