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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server is caching old request split chunks, and these are not being re-requested when a new request is made to the server. #1007

Open
RishabJS opened this issue Apr 23, 2024 · 0 comments

Comments

@RishabJS
Copy link

RishabJS commented Apr 23, 2024

馃悰 Bug Report

Server is not emitting fresh split chunks on new requests; instead, it is caching the chunks from previous requests and merging them with the new ones

Project Dependencies
React: 18
React-router: 6.18
Loadable: 5.16
Node: 16.17
NPM: 8.15

To Reproduce

Steps to reproduce the behavior:
when server is made up on first request all the split chunks are emitted correctly (url:http://localhost:5000/artist/unknown/6214cdf1f83bd744e8ab2851?pageId=artistDetail) ->
Screenshot 2024-04-23 at 2 38 54 PM

on second request to different url (http://localhost:5000/account-deletion), previous req chunk (<script async="" data-chunk="ArtistContainer" src="./static/js/artist.a7a73238.js"></script>) is also made with new chunks ->
Screenshot 2024-04-23 at 2 53 50 PM

Implementation Details->

SSR implementation:
Screenshot 2024-04-23 at 3 02 04 PM

Element Render component
Screenshot 2024-04-23 at 3 02 56 PM

CSR Implementation
Screenshot 2024-04-23 at 3 04 36 PM

It has been observed that in chunkExtractor.js of @loadable/server, the class variable this.chunks retains the previous chunks in its list when a new HTML is returned upon requesting a new URL
Screenshot 2024-04-23 at 3 07 15 PM

Expected behavior

The server should emit all necessary split chunks on each new request, and it should not cache the chunks from previous requests

In the above snippets static/js/artist.a7a73238.js chunk should not be emitted by the server as it doesn't belong to the currently requested url

Link to repl or repo (highly encouraged)

Please provide a minimal repository on GitHub.

Issues without a reproduction link are likely to stall.

Run npx envinfo --system --binaries --npmPackages @loadable/component,@loadable/server,@loadable/webpack-plugin,@loadable/babel-plugin --markdown --clipboard

Paste the results here:

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

No branches or pull requests

1 participant