Skip to content
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

vite, hmr, & webpack Script Tag Duplication #77

Closed
6 tasks done
mrose opened this issue Nov 15, 2024 · 4 comments
Closed
6 tasks done

vite, hmr, & webpack Script Tag Duplication #77

mrose opened this issue Nov 15, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@mrose
Copy link

mrose commented Nov 15, 2024

Describe the bug

Using page-based routing, when I use Suspense the three scripts are duplicated. The duplicated scripts appear after the suspended component is rendered on the browser. Let me know if you need more to repro.
Screenshot 2024-11-15 at 2 09 14 PM

Reproduction

No response

Steps to reproduce

Create an async page which imports a Delay component and React Suspense.
The async Delay component uses setTimeout to delay the output of some text.
Open the dev server and display the page in the browser.

System Info

System:
    OS: Linux 6.1 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD EPYC 7B13
    Memory: 45.26 GB / 62.79 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.17.0/bin/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
    pnpm: 9.9.0 - ~/.nvm/versions/node/v20.17.0/bin/pnpm
  npmPackages:
    @lazarv/react-server: v0.0.0-experimental-63ba3e1-20241108-58695b8a => 0.0.0-experimental-63ba3e1-20241108-58695b8a 
    vite: 6.0.0-beta.8 => 6.0.0-beta.8

Used Package Manager

pnpm

Logs

No response

Validations

@mrose mrose added the pending triage Pending triage label Nov 15, 2024
@lazarv lazarv self-assigned this Nov 15, 2024
@lazarv lazarv added bug Something isn't working and removed pending triage Pending triage labels Nov 15, 2024
@lazarv
Copy link
Owner

lazarv commented Nov 15, 2024

Thanks for reporting @mrose! I was able to reproduce the bug and this happens when you don't use any client components before a Suspense boundary, but then you're adding a client component inside the Suspense. A fix is already on the way!

lazarv added a commit that referenced this issue Nov 16, 2024
This fixes an issue about adding scripts to the HTML document in
development mode for HMR when the initial page don't use a client
component, but a client component is rendered in a `<Suspense>`
boundary. #77

Adds a test to verify this use case from now on.
@lazarv
Copy link
Owner

lazarv commented Nov 16, 2024

Please check this issue using the latest version of the framework, as it is now available to install. Please let me know if the issue persists in another use case and if so, then please provide a reproduction to have more info on this.

@mrose
Copy link
Author

mrose commented Nov 18, 2024

confirmed fixed so closing

@mrose mrose closed this as completed Nov 18, 2024
Copy link

This issue has been locked since it has been closed for more than 30 days.

If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest version of @lazarv/react-server. If you have any other comments you should create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants