-
-
Notifications
You must be signed in to change notification settings - Fork 701
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
Different wasm filenames between cargo leptos serve
and cargo leptos build
#1337
Comments
cargo leptos serve
and `cargo leptos build´cargo leptos serve
and cargo leptos build
This comes from some code that's used to ensure compatibility between scenarios in which people are building the frontend with leptos/integrations/utils/src/lib.rs Lines 53 to 59 in 8a90f97
However, this compile-time check is inadvertently done at runtime instead here leptos/integrations/utils/src/lib.rs Lines 89 to 95 in 8a90f97
This means what you need to do is Will fix in a PR in a second. |
That was a very easy fix. With this the ENV set beforehand it works fine. Thank you for the fast reply! |
Describe the bug
I stumpled across this while I wanted to provide my input to the Docs issue.
The
index
page requests different file names between acargo leptos build (-r)
andcargo leptos serve
, which makes the build step fail. This happens with leptos in SSR mode.When I execute it in development mode with either
cargo leptos serve
orwatch
, the<link>
matches the filename on the system:When I execute the compiled binary, it requests the following
wasm
in the html with the added_bg
, which does not exist at all intarget/site
, only the filename from above does:Leptos Dependencies
A list of dependencies would be pretty complex, since this a workspace'd setup.
The basis is the
start-axum
template from the docs though from a few days ago.Expected behavior
I would expect the same filename all the time, no matter at what stage we are.
I don't know where the
_bg
is coming from or if there is maybe a good reason for this, but with this being added, I can only make a deployment work with a manual workaround in code inside my custom static files handler and basically rewrite the request from the browser and remove the_bg
so it actually maps to an existing wasm file.Screenshots
I am using rust_embed for all static files to only have a single binary in the end and also
a custom handler for the static files. I just quickly added some debug logging to actually compare what is availbale and what is requested. It is working fine during
cargo leptos serve
but will fail like in the screenshot aftercargo leptos build
and then manually executing the binary:The
.br
extension is added by me manually since I want to serve precompressed files. But just to prove, that I did not add this_bg
somehow, here a screenshot from the sourcecode from the browser:While it does not have the
_bg
extension withcargo leptos serve
:If any additional information is needed, please let me know.
I am just in the middle of creating a template for a few upcoming projects that should be based on leptos, but I could push it even though it is not complete yet.
The text was updated successfully, but these errors were encountered: