-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Types are not properly updated for routes under group layouts #6842
Comments
If it helps. It looks like line 74-75 in const route = manifest_data.routes.find((route) => route.id === id);
if (!route) return; // this shouldn't ever happen route is however undefined for routes under a (layout group) |
williamviktorsson
added a commit
to williamviktorsson/kit
that referenced
this issue
Sep 15, 2022
Fixes sveltejs#6842: Types are not properly updated for routes under group layouts routes were not found by id under group layouts. replacing '\' with '/' fixes this for route id's.
5 tasks
Seemingly a windows related bug as it relates to route id's not being found under layout groups, with the occurance of I was not able to reproduce the issue on a Mac. |
Rich-Harris
added a commit
that referenced
this issue
Sep 16, 2022
* fix route's not being found by id under group layouts Fixes #6842: Types are not properly updated for routes under group layouts routes were not found by id under group layouts. replacing '\' with '/' fixes this for route id's. * update to conform to linting * Update packages/kit/src/core/sync/write_types/index.js * Update packages/kit/src/core/sync/write_types/index.js * Create six-pants-melt.md Co-authored-by: Rich Harris <hello@rich-harris.dev>
dummdidumm
pushed a commit
that referenced
this issue
Sep 20, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When altering return values from actions / load functions in +page.server.(ts/js) , the corresponding types are automagically updated while running
npm run dev
.This experience breaks for routes under layout groups.
Under layout groups, one seems to be required to run
npx svelte-kit sync
and restart the language server if running vscode to get the latest types.When moving such routes with said issue, away from a layout group, the wonderful DX resumes.
Reproduction
This is a reproduction of the issue, taking the base demo-todo-app and putting all routes under a shared (groups) layout group.
Running the project and updating any return values from e.g. the (groups)/login/+page.server.js does not trigger an update in the generated types.
Moving the same route out of the (groups) layout group fixes the issue.
https://github.com/williamviktorsson/layout-groups-typing-bug
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
Layout groups reduce boilerplate code amongst other things, improving DX.
However, losing the great typing experience is a larger loss in DX.
The text was updated successfully, but these errors were encountered: