Skip to content
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

Hot reload doent work #425

Open
KOEGlike opened this issue Jan 25, 2025 · 4 comments
Open

Hot reload doent work #425

KOEGlike opened this issue Jan 25, 2025 · 4 comments

Comments

@KOEGlike
Copy link

I have this project, hot reload worked like 2 months ago, but than i didn't work on this project until now. I updated leptos, and cargo-lepots, and then it stopped working.

@KOEGlike
Copy link
Author

in the console it says this:

[HOT RELOADING] Connected to server.

Note: `cargo-leptos watch --hot-reload` only works with the `nightly` feature enabled on Leptos.

but i have nightly enabled

@gbj
Copy link
Contributor

gbj commented Jan 25, 2025

The statement "Hot reload doesn't work" isn't true, as a general statement; I spent an hour or so yesterday working with it for a demo for an upcoming talk.

Could you provide some more specific way to describe or reproduce the problem you're experiencing?

@paul-hansen
Copy link
Contributor

@KOEGlike I tried out your project, and it looks like it is working for me but only if I edit something in the HomePage component, it seems like changing the text in your CreateIsland component doesn't work.

NOTE: The notice in the js console that says "--hot-reloadonly works with thenightly`" will show regardless of if it's working or not.

This is an example of what I changed in your HomePage component that worked:

#[component]
pub fn HomePage() -> impl IntoView{
    view! {
        <div id="home-page">
            "I added this text. Change it and it will hot reload"
            <JoinIsland/>
            <CreateIsland/>
        </div>
    }
}

There must be some limitation that makes what your doing in your components not hot reload. The hot-reload feature isn't documented anywhere that I found so we'll have to look at the code or just make guesses to figure that out. Perhaps it doesn't work inside an Either? not sure. I personally use stable Rust so haven't messed with it much.

@gbj
Copy link
Contributor

gbj commented Jan 28, 2025

Note also that (apart from occasional glitches), there's one specific situation I'm aware of in which hot reloading doesn't work, which is in children that come after a component (leptos-rs/leptos#3191).

If that is what you're encountering, this can be closed as that one is known; in any case the hot-reloading code doesn't live in this repo, but over in the main leptos repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants