You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if we could provide a way of plugging this into something like Sentry for in-production, in-the-field collection of mismatch info.
What does the proposed API look like?
Since a mismatch is not a thrown error (and should not be), it currently just logs to the console. It would be nice if we could pass in some kind of onHydrationMismatch function, which gets called instead of warn.
It should get called once for each mismatch, if possible.
It should receive as arguments any DOM nodes and virtual nodes related to the mismatch.
The text was updated successfully, but these errors were encountered:
Following this, with the extra logging, we also saw some users using tools to translate from English to another language which then also causes a mismatch, without this extra logging it wouldn't of been possible to figure that out.
What problem does this feature solve?
It is currently hard to debug:
Since Vue 3.4 is is possible to include details about hydration mismatches in production using a compile time flag: https://vuejs.org/api/compile-time-flags.html#VUE_PROD_HYDRATION_MISMATCH_DETAILS , but it still just goes to the console.
The relevant code starts here:
core/packages/runtime-core/src/hydration.ts
Line 610 in 34106bc
It would be great if we could provide a way of plugging this into something like Sentry for in-production, in-the-field collection of mismatch info.
What does the proposed API look like?
Since a mismatch is not a thrown error (and should not be), it currently just logs to the console. It would be nice if we could pass in some kind of
onHydrationMismatch
function, which gets called instead ofwarn
.It should get called once for each mismatch, if possible.
It should receive as arguments any DOM nodes and virtual nodes related to the mismatch.
The text was updated successfully, but these errors were encountered: