You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But we may want to host several version of the app, like in the linked example: public_url = "/" gives an unreasonable constraint, and public_url = "./" gives precisely what is needed, i.e. locating WASM, stylesheets, etc relatively to index.html.
As the linked example shows, this works fine with trunk build, and I am able to generate Github Pages to serve the output of several branches in a single domain, but trunk serve rejects it, apparently due to a check deep inside Axum:
user@perso-dev:leptos-test (master<>)$ RUST_BACKTRACE=1 trunk serve
2024-02-01T20:41:08.580817Z INFO 🚀 Starting trunk 0.18.3
2024-02-01T20:41:08.874778Z INFO 📦 starting build
...
2024-02-01T20:41:12.765645Z INFO ✅ success
thread 'tokio-runtime-worker' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trunk-0.18.3/src/serve.rs:278:27:
Paths must start with a `/`
stack backtrace:
0: rust_begin_unwind
at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/std/src/panicking.rs:645:5
1: core::panicking::panic_fmt
at /rustc/3f28fe133475ec5faf3413b556bf3cfb0d51336c/library/core/src/panicking.rs:72:14
2: axum::routing::Router<S,B>::nest_service
3: trunk::serve::router
4: trunk::serve::ServeSystem::spawn_server::{{closure}}::{{closure}}
5: trunk::serve::ServeSystem::run::{{closure}}::{{closure}}
6: trunk::serve::ServeSystem::run::{{closure}}
7: tokio::runtime::task::raw::poll
8: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
9: tokio::runtime::task::raw::poll
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aborted
The text was updated successfully, but these errors were encountered:
The default
public_url = "/"
is only suitable when using one server per app, which may not be possible. For example in a project hosted on Github we only get one domain for use with Github Pages.But we may want to host several version of the app, like in the linked example:
public_url = "/"
gives an unreasonable constraint, andpublic_url = "./"
gives precisely what is needed, i.e. locating WASM, stylesheets, etc relatively toindex.html
.As the linked example shows, this works fine with
trunk build
, and I am able to generate Github Pages to serve the output of several branches in a single domain, buttrunk serve
rejects it, apparently due to a check deep inside Axum:The text was updated successfully, but these errors were encountered: