Comments (2)
I just wanna mention a fix that tried to apply:
// main.rs
cfg_if::cfg_if! {
if #[cfg(feature = "ssr")] {
#[shuttle_runtime::main]
async fn axum() -> shuttle_axum::ShuttleAxum {
use axum::{extract::Extension, routing::post, Router};
use leptos::*;
use leptos_axum::{generate_route_list, LeptosRoutes};
use leptos_tailwind::app::*;
use leptos_tailwind::fileserv::file_and_error_handler;
use std::sync::Arc;
// Setting get_configuration(None) means we'll be using cargo-leptos's env values
// For deployment these variables are:
// <https://github.com/leptos-rs/start-axum#executing-a-server-on-a-remote-machine-without-the-toolchain>
// Alternately a file can be specified such as Some("Cargo.toml")
// The file would need to be included with the executable when moved to deployment
let conf = get_configuration(Some("Cargo.toml")).await.unwrap();
let leptos_options = conf.leptos_options;
let routes = generate_route_list(|cx| view! { cx, <App/> }).await;
// build our application with a route
let app = Router::new()
.route("/api/*fn_name", post(leptos_axum::handle_server_fns))
.leptos_routes(leptos_options.clone(), routes, |cx| view! { cx, <App/> })
.fallback(file_and_error_handler)
.layer(Extension(Arc::new(leptos_options)));
Ok(app.into())
}
} else {
pub fn main() {
// no client-side main function
// unless we want this to work with e.g., Trunk for a purely client-side app
// see lib.rs for hydration function instead
}
}
}
This code generation from the SSR should not be compiled in the frontend when the frontend is built with:
LEPTOS_OUTPUT_NAME=tailwind LEPTOS_SITE_ROOT=site LEPTOS_SITE_PKG_DIR=pkg LEPTOS_SITE_ADDR=127.0.0.1:8000 LEPTOS_RELOAD_PORT=3001 LEPTOS_LIB_DIR=. LEPTOS_BIN_DIR=. cargo build --package=leptos-tailwind --lib --target-dir=target/front --target=wasm32-unknown-unknown --no-default-features --features=hydrate
The error outputed is the one that joshua shared in the OP(from the SSR feature branch while compiling the hydrate feature)
from shuttle.
I'd love to use shuttle for an SSR'd Leptos site, watching this issue for progress 👍
from shuttle.
Related Issues (20)
- Discord Invite Invalid [Bug]: HOT 4
- [Bug]: panic `cargo shuttle deploy` HOT 1
- [Bug]: thread 'main' panicked at 'shuttle-runtime version should be in the `name version` format' HOT 3
- [Improvement]: Consider if migrating to `tower-sessions` is appropriate HOT 2
- [Improvement]: Container databases for local runs of projects with db resources receive a random host port
- [Bug]: cargo-shuttle login panics HOT 5
- [Improvement]: Improve auth integration tests for pro users
- [Feature]: Add a shuttle-admin command to invalidate gateway auth cache HOT 2
- [Feature]: auto reload HOT 2
- [Improvement]: `--raw` parameter for commands that print tables HOT 3
- [Improvement]: Remove redundant hint based on row count HOT 3
- [Improvement]: Integrate with OpenDAL for more storage services support for Shuttle Persist HOT 1
- [Bug]: Deployment logs at the start of deployment are delayed
- [Improvement]: Remove pin to version 0.30.1 of libsql-client in Shuttle Turso HOT 1
- [Bug]: Can't update git-versioning based crates on shuttle
- [Improvement]: Allow other async runtimes than tokio, such as async-std HOT 1
- [Feature]: Expose connection string from shared db HOT 1
- [Improvement]: rocket v0.5.0-rc.4 HOT 2
- [Bug]: show-secrets replaces shared DB URL HOT 1
- [Improvement]: Generate manpage with `clap-mangen` for `cargo-shuttle` HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shuttle.