Skip to content

Quarto preview only loading homepage in Firefox #3045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
tomvaneyck opened this issue Oct 26, 2022 · 5 comments
Closed
4 tasks done

Quarto preview only loading homepage in Firefox #3045

tomvaneyck opened this issue Oct 26, 2022 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@tomvaneyck
Copy link
Contributor

tomvaneyck commented Oct 26, 2022

Bug description

When previewing a website in Firefox using quarto preview, only the homepage loads; whenever clicking any other link in both the navbar or sidebar, the homepage reloads. Quarto gives the following output on clicking a link (but only sometimes):

GET: /about.html
WARNING: connection closed before message completed
GET: /

while Firefox shows the following in the developer tools:

afbeelding

I'm using Quarto v1.2.242 and see the result both running on Windows 11 in Powershell and in WSLv1.

Reproducing

  1. Create a new website using quarto create project website.
  2. Execute quarto preview.

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.
@tomvaneyck tomvaneyck added the bug Something isn't working label Oct 26, 2022
@cscheid cscheid added windows and removed windows labels Oct 26, 2022
@cscheid
Copy link
Collaborator

cscheid commented Oct 26, 2022

I can reproduce this on OS X as well.

@cscheid cscheid added this to the v1.2 milestone Oct 26, 2022
@cscheid cscheid self-assigned this Oct 26, 2022
@jjallaire
Copy link
Collaborator

jjallaire commented Oct 26, 2022

This is going to have to do with how we subscribe/unsubscribe from socket messages in devserver-core.html (I made a change there recently to handle a behavior I saw in Electron (computer suspend causes websockets to get disconnected) but doesn't happen in Chrome:

// if the socket closes for any reason (e.g. this occurs in electron apps
// when the computer suspends) then reload to reestablish the connection 
devServerSocket.onclose = () => {
    console.log('Socket connection closed. Reloading.');
    window.location.reload(true);
}

We definitely need to keep this behavior, but it may need some adaptation for Firefox.

@cscheid
Copy link
Collaborator

cscheid commented Oct 26, 2022

The issue seems to be "simply" that Firefox closes websockets on navigation events, and Chrome doesn't: https://stackoverflow.com/questions/10965720/should-websocket-onclose-be-triggered-by-user-navigation-or-refresh

@jjallaire
Copy link
Collaborator

jjallaire commented Oct 26, 2022 via email

@nil-is-lin
Copy link

WARNING: connection closed before message completed. I meet this problem again, quarto 1.3.450, windows 11, edge and chrome have been test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants