Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Close event source before window is unloaded #945

Merged
merged 1 commit into from
Jun 1, 2020

Conversation

klaussner
Copy link
Contributor

If Sapper is run in development mode, Firefox outputs a (meaningless) error in the console every time the page is reloaded manually or after a reload action was received by the dev client's EventSource:

sapper-firefox-console

This seems to be a bug in Firefox because the error doesn't occur in Chrome or Safari. I've added an event listener that closes the event source before the window is unloaded, which prevents the error.

@thgh
Copy link
Contributor

thgh commented Nov 9, 2019

Fixes #981

Edit: here is how I fixed it: thgh@97f9bf0 but this PR is better

@ryanatkn
Copy link

Just wanted to confirm for any reviewers that I was experiencing this issue and had an identical fix.

@Conduitry Conduitry merged commit 4f9f759 into sveltejs:master Jun 1, 2020
@grundmanise
Copy link

grundmanise commented Jun 6, 2020

FYI. The same is observed in Chrome when the connection is not explicitly closed.
macOS 10.15.4
Chrome 83.0.4103.61 (Official Build) (64-bit)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants