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

[0.7] LocalResources loaded in islands do not trigger Suspense in non-island parents #2972

Open
Houski opened this issue Sep 14, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@Houski
Copy link
Contributor

Houski commented Sep 14, 2024

Describe the bug
Islands do not render in nested components under certain conditions. Everything inside the parent transition appears not to render.

To Reproduce
Run this minimum example repo:
https://github.com/Houski/leptos_07_beta_bug_repros

@gbj
Copy link
Collaborator

gbj commented Sep 14, 2024

Okay, the conditions here are specifically:

  1. using a LocalResource,
  2. in an island,
  3. with the Suspense/Transition outside the island

Things that work:

  1. putting a Suspense/Transition inside the island, or
  2. using a Resource instead of LocalResource

I'm not sure this should break in exactly the way it does, but I can at least explain the intuition for why it doesn't work: Because the Suspense/Transition is outside the island, there is nothing actually shipped to the client that knows how to run the async loading + rendering here. i.e., the client does not have the code that says "Ok, wait for all the data inside this area to be loaded, and then show it," (the Suspense/Transition) but the server does not have the code that says "Ok, wait until you've loaded all this data, then render the HTML" (because you've told it not to load the data by using a LocalResource for the data).

@Houski
Copy link
Contributor Author

Houski commented Sep 15, 2024

Would it be easy to have it throw an error under those conditions or is there no way for Leptos to derive that structure has occured?

In my case I actually can just make it a regular resource I think. I'm actually not even sure why I have it as local resource. 🤔

@gbj gbj changed the title 7.0 beta - Islands do not render in nested components in islands mode under certain conditions [0.7] Resources loaded in islands do not trigger Suspense in non-island parents Sep 17, 2024
@gbj gbj changed the title [0.7] Resources loaded in islands do not trigger Suspense in non-island parents [0.7] LocalResources loaded in islands do not trigger Suspense in non-island parents Sep 17, 2024
@gbj gbj added the documentation Improvements or additions to documentation label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants