Skip to content

Commit

Permalink
fix: only skip hydration with vite overlay if current page is an error (
Browse files Browse the repository at this point in the history
#9892)

This function only runs after navigations or on the initial load and in those cases you would almost always be on the error page if there is an error.

Since our tests are concurrent, the overlay is created even if the error was meant for another tab and skipping hydration prevents the rest of the test from running.

It's not the ideal solution, but currently Playwright doesn't offer a way to run specific tests without concurrency.

Right now there is one test where the overlay is expected but the overlay causes flakiness in other tests because it is unintentionally broadcasted to them.
  • Loading branch information
gtm-nayan authored May 10, 2023
1 parent b328c79 commit bc70b4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/shy-pears-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: only skip hydration with vite overlay if current page is an error
2 changes: 1 addition & 1 deletion packages/kit/src/runtime/client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export function create_client(app, target) {

/** @param {import('./types').NavigationFinished} result */
function initialize(result) {
if (DEV && document.querySelector('vite-error-overlay')) return;
if (DEV && result.state.error && document.querySelector('vite-error-overlay')) return;

current = result.state;

Expand Down

0 comments on commit bc70b4e

Please sign in to comment.