Leptos not generating JS and WASM files when I cargo leptos watch. It does generate the css file in the target/site/pkg. It will buld the saite, but the site has no functionality. I have spent waaay too long on this and just want it running like it should. Any help? There is not git repo, only local so the error is confusing when I use verbose. Other wise no error... I can see as the terminal cuts off before it ends.
Note: I am
cargo leptos build -v
Location:
C:\Users\me\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\cargo-leptos-0.3.10\src\command\build.rs:25
ββββββββββββββββββββββββββββββββββ BACKTRACE βββββββββββββββββββββββββββββββββββ
1: git_filter_source_repo<unknown> at <unknown source file>:<unknown line>
2: git_filter_source_repo<unknown> at <unknown source file>:<unknown line>
3: git_diff_stats_to_buf<unknown> at <unknown source file>:<unknown line>
4: BaseThreadInitThunk<unknown> at <unknown source file>:<unknown line>
5: RtlUserThreadStart<unknown> at <unknown source file>:<unknown line>
.cargo/config.toml
#to stop a recursation involving thaw going 130 levels deep
[build]
rustflags = ["--cfg", "erase_components"]
lib.rs
pub mod app;
pub mod db;
#[cfg(feature = "hydrate")]
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn hydrate() {
Β Β use crate::app::*;
Β Β console_error_panic_hook::set_once();
Β Β leptos::mount::hydrate_body(App);
}
Cargo.toml
[package]
name = "example-leptos"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
leptos = { version = "0.8.23", features = ["ssr"] }
leptos_router = { version = "0.8.17" }
axum = { version = "0.8.8", features = ["ws", "macros", "multipart", "http2"], optional = true }
axum-extra = { version = "0.12.5", features = ["protobuf", "multipart", "typed-header"], optional = true}
axum-server = Β { version = "0.9.0", features = ["tls-rustls"], optional = true }
console_error_panic_hook = { version = "0.1", optional = true }
leptos_axum = { version = "0.8.0", optional = true }
leptos_meta = { version = "0.8.7" }
tokio = { version = "1.54.1", features = ["macros", "rt-multi-thread"], optional = true }
wasm-bindgen = { version = "0.2.130", optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
cookie = { version = "0.18.1", optional = true }
blob = "0.3.0"
bytes = "1.9.0"
bytes-utils = "0.1.4"
chrono = { version = "0.4.44", features = ["alloc","serde"]}
derivative = "2.1.0"
dotenv = "0.15.0"
env_logger = "0.11.6"
fred = { version = "10.0.4", features = ["serde-json", "enable-rustls", "rustls"], optional = true }
futures = "0.3.34"
futures-util = "0.3.34"
generic-array = "1.4.5"
hex-literal = "1.0.0"
http = "1.5.0"
image = "0.25.6"
lazy_static = "1.5.0"
lettre = "0.11.23"
lettre_email = "0.9.4"
log = "0.4.34"
rand = "0.10.3"
reqwest = { version = "0.13.5", features = ["json"] }
rust_decimal = "1.43.0"
serde = { version = "1.0.229", features = ["derive"] }
serde_json = "1.0.151"
sqlx = { version = "0.9.0", features = ["rust_decimal", "postgres", "runtime-tokio", "tls-rustls", "uuid", "chrono"], optional = true }
thiserror = "2.0.21"
tokio-task-scheduler = { version = "1.0.0", optional = true }
tower-http = { version = "0.7.1", features = ["compression-br", "compression-gzip","limit", "trace","cors","fs"], optional = true }
tower-sessions = { version = "0.15.0", optional = true }
tower-sessions-core = { version = "0.15.0", optional = true }
tower-sessions-redis-store = { version = "0.17.0", optional = true }
tower_governor = { version = "0.8.0", optional = true }
tracing = "0.1.44"
tracing-subscriber = { version = "0.3.22", features = ["env-filter"] }
webauthn-rs = { version = "0.6.2", features = ["danger-allow-state-serialisation", "danger-credential-internals"], optional = true }
thaw = { version = "0.5.0-beta", features = ["ssr"] }
leptos-remix-icon = "1.0.3"
leptos-use = "0.20.0"
icondata_core = "0.1.0"
tower = { version = "0.5.3", optional = true }
cfg-if = "1.0.5"
icondata = "0.7.0"
meilisearch-sdk = { version = "0.33.0", optional = true }
leptos_meilisearch = "0.7.0"
dotenvy = "0.15.7"
leptos-use-window = "0.20.1"
time = "0.3.55"
[dependencies.web-sys]
version = "0.3.107"
optional = true
features = ["AbortController", "AbortSignal", "AuthenticationExtensionsClientOutputs", "AuthenticatorResponse", "Clipboard", "CredentialCreationOptions", "CredentialRequestOptions", "CredentialsContainer", "DomException", "Element", "Event", "Headers", "HtmlCollection", "HtmlSelectElement", "Navigator", "PublicKeyCredential", "PublicKeyCredentialCreationOptions", "PublicKeyCredentialRpEntity", "PublicKeyCredentialUserEntity", "Request", "RequestCredentials", "RequestInit", "RequestMode", "RequestRedirect", "Response", "Window"]
[dependencies.webauthn-rs-proto]
version = "0.6.2"
default-features = false
features = ["wasm"]
[features]
hydrate = [
Β Β "leptos/hydrate",
Β Β "thaw/hydrate",
Β Β "dep:console_error_panic_hook",
Β Β "dep:wasm-bindgen",
Β Β "dep:wasm-bindgen-futures",
Β Β "dep:web-sys",
]
ssr = [
Β Β "dep:axum",
Β Β "dep:axum-extra",
Β Β "dep:axum-server",
Β Β "dep:cookie",
Β Β "dep:tokio",
Β Β "dep:tokio-task-scheduler",
Β Β "dep:leptos_axum",
Β Β "dep:fred",
Β Β "dep:sqlx",
Β Β "dep:tower",
Β Β "dep:tower-http",
Β Β "dep:tower-sessions",
Β Β "dep:tower-sessions-core",
Β Β "dep:tower-sessions-redis-store",
Β Β "dep:meilisearch-sdk",
Β Β "dep:webauthn-rs",
Β Β "dep:tower_governor",
Β Β "leptos/ssr",
Β Β "leptos-use/ssr",
Β Β "leptos_meta/ssr",
Β Β "leptos_router/ssr",
Β Β "thaw/ssr",
]
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.4.3", features = ["wasm_js"] }
[target.'cfg(target_arch = "wasm64")'.dependencies]
getrandom = { version = "0.4.3", features = ["wasm_js"] }
# Defines a size-optimized profile for the WASM bundle in release mode
[profile.wasm-release]
inherits = "release"
opt-level = 'z'
lto = true
codegen-units = 1
panic = "abort"
[package.metadata.cargo-all-features]
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
skip_feature_sets = [["ssr", "hydrate"]]
[package.metadata.leptos]
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
output-name = "example-leptos"
# The site root folder is where cargo-leptos generate all output. WARNING: all content of this folder will be erased on a rebuild. Use it in your server setup.
site-root = "target/site"
# The site-root relative folder where all compiled output (JS, WASM and CSS) is written
# Defaults to pkg
site-pkg-dir = "pkg"
# [Optional] The source CSS file. If it ends with .sass or .scss then it will be compiled by dart-sass into CSS. The CSS is optimized by Lightning CSS before being written to <site-root>/<site-pkg>/example-leptos.css
style-file = "style/main.scss"
# Assets source dir. All files found here will be copied and synchronized to site-root.
# The assets-dir cannot have a sub directory with the same name/path as site-pkg-dir.
#
# Optional. Env: LEPTOS_ASSETS_DIR.
assets-dir = "public"
# The IP and port (ex: 127.0.0.1:3000) where the server serves the content. Use it in your server setup.
site-addr = "127.0.0.1:3000"
# The port to use for automatic reload monitoring
reload-port = 3001
# [Optional] Command to use when running end2end tests. It will run in the end2end dir.
# Β [Windows] for non-WSL use "npx.cmd playwright test"
# Β This binary name can be checked in Powershell with Get-Command npx
end2end-cmd = "npx playwright test"
end2end-dir = "end2end"
# Β The browserlist query used for optimizing the CSS.
browserquery = "defaults"
# The environment Leptos will run in, usually either "DEV" or "PROD"
env = "DEV"
# The features to use when compiling the bin target
#
# Optional. Can be over-ridden with the command line parameter --bin-features
bin-features = ["ssr"]
# If the --no-default-features flag should be used when compiling the bin target
#
# Optional. Defaults to false.
bin-default-features = false
# The features to use when compiling the lib target
#
# Optional. Can be over-ridden with the command line parameter --lib-features
lib-features = ["hydrate"]
# If the --no-default-features flag should be used when compiling the lib target
#
# Optional. Defaults to false.
lib-default-features = false
# The profile to use for the lib target when compiling for release
#
# Optional. Defaults to "release".
lib-profile-release = "wasm-release"