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

Layout slot is not updating after updating Svelte to 3.24.1 #8

Closed
ozzym1096 opened this issue Aug 21, 2020 · 7 comments
Closed

Layout slot is not updating after updating Svelte to 3.24.1 #8

ozzym1096 opened this issue Aug 21, 2020 · 7 comments

Comments

@ozzym1096
Copy link

With hotReload: true, the layout slot will not update when navigating to a different route. There is no problem with HMR when Svelte v3.24.0 is installed.

@n-pn
Copy link

n-pn commented Aug 22, 2020

confirmed. not working with svelte ^3.24.0. had to downgrade to ~3.23.2 to make it works again.

@slightlyfaulty
Copy link

It looks like this might have already been fixed in rixo/svelte-hmr#18, but svelte-loader-hot doesn't seem to be compatible with the later versions of svelte-hmr.

@rixo
Copy link
Owner

rixo commented Aug 24, 2020

Thanks for the feedback.

Indeed, there was an incompatibility with Svelte 3.24.1 that was fixed in latest svelte-hmr, and svelte-loader has not been updated to use that yet.

I have just released the required changes as svelte-loader-hot@0.3.1-1 (yarn add -D svelte-loader-hot@next). Can someone try this next version and see if it solves this issue? (Checking if nothing is obviously broken would be nice too!)

Unfortunately, that wouldn't explain @nipinium's problem since, as far as I know, svelte@3.24.0 was not affected by the problem fixed by last version of svelte-hmr...

To be totally frank, I don't really get what's the issue here... Given we're talking about layouts & slots, I've tried my luck with sapper-template-hot#webpack example, with latest Svelte (3.24.1 indeed), but I don't seem to be able to reproduce the problem mentioned here, neither with current version of svelte-loader-hot, nor with the next version I've just pushed... HMR updates seems to work correctly both when I modify _layout.svelte or a page file...

Maybe some (all?) of you are talking about Routify? Can anyone share a complete example illustrating this problem?

@slightlyfaulty
Copy link

Just tested and can confirm the update fixes the issue for me. Thanks @rixo!

In my case I wasn't using slots (or Routify), there were just some parts of reactivity not updating properly in a relatively small component hierarchy. I've managed to reproduce the issue as minimally as I can: svelte-loader-hot-repro-8

I assume @nipinium was indeed using 3.24.1, he was just using the ^3.24.0 version range.

@rixo
Copy link
Owner

rixo commented Aug 24, 2020

Good to hear, thanks for the feedback @slightlyfaulty. I've published the new version as a patch release (v0.3.1), so people can get support for Svelte 3.24.1 without having to think about it (big thanks to @dominikg for the actual fix in svelte-hmr, btw).

I have personally stopped using Webpack for Svelte projects, so the development of svelte-loader-hot has been lagging a bit behind... This kind of issues really helps to get some focus on what's important, and a big boost to motivation, to know that this work is actually useful to someone. And so, don't hesitate to open them when needed!

Cheers guys!

@ozzym1096
Copy link
Author

Thank you for the quick patch @rixo! I will go ahead and close this issue.

I'm not familiar at all with the inner workings of Svelte, but, like you, I couldn't find anything that would have caused an issue.
And I was actually working on a demo site using Sapper when I noticed the issue.

@n-pn
Copy link

n-pn commented Aug 30, 2020

thanks for the quick fix, @rixo.
I had expected this would take weeks to happen.

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

4 participants