Commit 5121479
fix: avoid client modules while traversing dependencies to prevent FOUC during dev (#14577)
* fix: avoid client modules while traversing dependencies to prevent FOUC during dev
This tweaks the way we're traversing dependencies to avoid a flash of unstyled content during dev. Previously we were using `getModuleByURL` which loads both the client and server version of the module. This means that server-only dependencies can end up being loaded into the client module graph, which is more likely to happen with remote modules.
Example:
+page.svelte -> foo.remote.ts -> {client: nothing, server: server-only-dependency } -> getModuleByURL for both client and server of server-only dependency -> crash
I'm not totally sure if this may have been a somewhat hidden breaking change from Vite 5 -> 6, but either way this ensures that Vite 5-7 now only load the ssr variant.
Fixes #14519
* snake_case
---------
Co-authored-by: Rich Harris <[email protected]>1 parent cde1458 commit 5121479
File tree
2 files changed
+28
-10
lines changed- .changeset
- packages/kit/src/exports/vite/dev
2 files changed
+28
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
614 | | - | |
| 613 | + | |
| 614 | + | |
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
622 | | - | |
| 622 | + | |
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | | - | |
| 632 | + | |
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
639 | | - | |
640 | | - | |
641 | | - | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
642 | 645 | | |
643 | 646 | | |
644 | | - | |
645 | | - | |
| 647 | + | |
| 648 | + | |
646 | 649 | | |
647 | 650 | | |
648 | 651 | | |
| |||
651 | 654 | | |
652 | 655 | | |
653 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
654 | 667 | | |
655 | 668 | | |
656 | 669 | | |
| |||
0 commit comments