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

chore: improve SSR invalid element error message #11585

Merged
merged 13 commits into from
May 14, 2024

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented May 13, 2024

This should make error messages for invalid elements during SSR better, as it lets you know what component the element is in. Addressing part of the problem from #10630. In a follow up, once I have time, it would be good to add line numbers too to the filenames.

Before
Screenshot 2024-05-13 at 13 38 26

After
Screenshot 2024-05-13 at 13 38 03

Copy link

changeset-bot bot commented May 13, 2024

🦋 Changeset detected

Latest commit: f647f30

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

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

@Rich-Harris
Copy link
Member

I didn't realise we were doing this error_on_client stuff — shouldn't we just be erroring on the server?

@trueadm
Copy link
Contributor Author

trueadm commented May 13, 2024

@Rich-Harris The issue was that no one was seeing that error and if we threw an actual error than the server instance would go down and that wasn't great. Since introducing error_on_client the amount of people complaining about incorrect HTML element nesting has dropped significantly – so it's working.

@Rich-Harris Rich-Harris mentioned this pull request May 13, 2024
5 tasks
@Rich-Harris Rich-Harris merged commit 1087e6f into main May 14, 2024
8 checks passed
@trueadm trueadm deleted the better-ssr-hydration-error branch May 14, 2024 18:45
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

Successfully merging this pull request may close these issues.

None yet

2 participants