Commit 68656d1
committed
fix(hydration): route mismatches via handleError when consumer set
Hydration mismatch errors were never routed through Vue's error
handling pipeline, so onErrorCaptured and app.config.errorHandler
could not catch them — making it hard to wire hydration mismatch
reporting into observability tools (fix #13154).
logMismatchError now calls handleError(..., HYDRATION_MISMATCH, false)
only when an explicit consumer is present:
- app.config.errorHandler is set, or
- some ancestor has registered onErrorCaptured.
Without a consumer, the per-mismatch warn() calls at the call sites
remain the only output, matching the prior default behavior — no
'Unhandled error during execution of hydration' warning is emitted
for SSR apps that have not opted in.
Adds ErrorCodes.HYDRATION_MISMATCH plus its 'hydration' info label,
passes the parent component instance to logMismatchError() at every
call site, and adds tests covering: app.config.errorHandler consumer,
onErrorCaptured consumer, single-emit semantics across multiple
mismatches, and the no-consumer path.
Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>1 parent bbdf86d commit 68656d1
3 files changed
Lines changed: 132 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
2627 | 2629 | | |
2628 | 2630 | | |
2629 | 2631 | | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
2630 | 2717 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | | - | |
64 | | - | |
65 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
66 | 98 | | |
67 | 99 | | |
68 | 100 | | |
| |||
191 | 223 | | |
192 | 224 | | |
193 | 225 | | |
194 | | - | |
| 226 | + | |
195 | 227 | | |
196 | 228 | | |
197 | 229 | | |
| |||
441 | 473 | | |
442 | 474 | | |
443 | 475 | | |
444 | | - | |
| 476 | + | |
445 | 477 | | |
446 | 478 | | |
447 | 479 | | |
| |||
474 | 506 | | |
475 | 507 | | |
476 | 508 | | |
477 | | - | |
| 509 | + | |
478 | 510 | | |
479 | 511 | | |
480 | 512 | | |
| |||
499 | 531 | | |
500 | 532 | | |
501 | 533 | | |
502 | | - | |
| 534 | + | |
503 | 535 | | |
504 | 536 | | |
505 | 537 | | |
| |||
617 | 649 | | |
618 | 650 | | |
619 | 651 | | |
620 | | - | |
| 652 | + | |
621 | 653 | | |
622 | 654 | | |
623 | 655 | | |
| |||
666 | 698 | | |
667 | 699 | | |
668 | 700 | | |
669 | | - | |
| 701 | + | |
670 | 702 | | |
671 | 703 | | |
672 | 704 | | |
| |||
695 | 727 | | |
696 | 728 | | |
697 | 729 | | |
698 | | - | |
| 730 | + | |
699 | 731 | | |
700 | 732 | | |
701 | 733 | | |
| |||
0 commit comments