-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Empty client layout load #542
Conversation
🦋 Changeset detectedLatest commit: dea5842 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Ah yes, I remember reading about that in a kit issue but cannot find it anymore, or was it a discussion 🤔 Regardless the gist was that you explicitly have to return |
Fixes #541
After working with @endigma, it turns out that the culprit for this issue was a rather innocent looking load function in a
+layout.ts
file:I poked around this for awhile but everything I found seemed to indicate that only relying on
+layout.server.ts
meant that if a load function returns an empty object, we lost the session data. So now, the vite plugin adds a load to the root layout that passes the server's value down to children (who can pick it up fromevent.data
before they have toawait parent()
.This honestly was a lot of stabbing in the dark since it my expectations were clearly not matching kit's behavior. If @fehnomenal has some time to look at this, I would be super appreciative.
To help everyone out, please make sure your PR does the following:
pnpm run tests
andcd integration && pnpm run tests
pnpm changeset