Closed ingvilddev closed 5 days ago
Latest commit: 6fcb80ce7914d828ef628586e05e2f532d240542
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
Fixes https://github.com/popeindustries/lit/issues/35
Maybe this is a very bad and naive suggestion on how this should be implemented, but I wondered if what is suggested in this PR is good enough 🤓
We are anyhow in need in our app to be able to better locate which (child) node that resulted in the hydration error.
What this PR includes
consoleUnexpectedTemplateResultError(...)
that prints the html element that caused hydration to fail, when it was due to an unexpected template result rendered to part.lit-html
PR changes explained
I debugged where the error was thrown and where the error was caught. It was not an obvious variable in either places that contained the information about which HTML element that caused it. The current implementation was the best place I could find it 🤓 Maybe it is a bad suggestion.
Before & After
Should not change functionality, since it is just a
console.error(...)
message that is changes.Before
After