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_address__ is not being replaced

LucaCappelletti94 opened this issue · comments

Hi!

I am finding myself with lots of errors such as the following:

login:673 WebSocket connection to 'wss://{{__trunk_address__}}/_trunk/ws' failed: 

I am running on a Chrome browser, macOS. This is our current Trunk configuration (permalink).

I suppose that this variable is meant to be replaced here in your code but for some reason, it is not. Do you have any idea what may cause this to happen?

I do not see any error reported in the log of the Trunk serve.

Which version of trunk are you running? Is there any reproducer that you can share?

Hi @ctron! The version is the latest published, 18.8. I still have to get a minimal reproducible setting, as myself I have no clue as to how this error emerged. I am currently packaging the whole development setup in Dockers, and my current suspects are related to some misconfiguration there. I am now fully rebuilding the Docker and will keep you posted.

That being said, is it correct that I should expect the address __trunk_address__ of the website to be replaced during build time?

That being said, is it correct that I should expect the address trunk_address of the website to be replaced during build time?

Yes. An it might very well be that that's an issue with that code.

I would also encourage you to try out 0.19.0-rc.1, which I just released. I briefly recall some changes in the area.

I have resolved it by making a spartan docker system prune --all to remove all Docker-related stuff, and by rebuilding cleanly the dockers for development (permalink) and deployment (permalink) it is now working.

I am really not sure about how this could cause Trunk serve to start without any error, refresh correctly upon Rust code edits but have the URL not being properly replaced.

Maybe it is an error being ignored or something of this nature in the implementation of Trunk 18.8.

If it happens again in the future, I will try to 19 version and let you know how it does.

I think we can close this issue for the time being, I will reopen if it represents by itself.

Thanks for following up!