-
Notifications
You must be signed in to change notification settings - Fork 32
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
Page island is rendered in slot of layout island #193
Comments
Hi David, thanks for reporting. This could be another case of modules being duplicated by Vite, or a bug in how the counter is reset after navigation. Would you check if there are two copies of |
Looks like But that seems to be the wanted behavior?
|
Gotcha, then it's option 2, thanks for checking.
The idea behind resetting was to simulate the behavior that would occur during build, where each page starts from I don't understand why this bug does not manifest in the docs site, need to check. Perhaps this has to do with how Vue reuses DOM elements when re-rendering the layout (if layout does not change between pages, islands in layout are not re-rendered, so Since ids are internal, a potential fix is to avoid resetting ids in development. The downside is that when using the dev tools, ids for islands would continue increasing until a full reload occurs. Currently, each island within a page should always have the same id. |
That theory turned out to be correct, released a fix in Fixed by changing the way ids are recycled during dev: instead of resetting to zero on navigation, we now mark ids as available once islands are unmounted. As a result, we prevent using ids which are currently taken, but ids still match what you would see during build, even as you navigate across pages: Thanks again for reporting! @davidlueder |
iles
andvite
.Description 📖
When islands are rendered within a layout file and within a page file, the page island hydration ids start with ile-1 again. The second component from the page is rendered in the slot of the layout component (see stackblitz example)
It seems to have something to do with the
newHydrationId()
function but i was not able to find the root cause:iles/packages/iles/src/client/app/hydration.ts
Line 22 in df8b793
Reproduction 🐞
https://stackblitz.com/edit/iles-ytnhui
npm run dev
- bug reproduciblenpm run now
- no bug (as expected becausenewHydrationId()
uses a different implementation for SSR during build)Logs 📜
The text was updated successfully, but these errors were encountered: