wrapPageElement and wrapRootElement Remount Layout Component on Page Navigation after redeploying to production Environment on Chrome After Upgrading to Gatsby 4.25.9 or 5.13.7 #39131
Labels
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
Thank you for taking the time to look into this issue. I recently upgraded my Gatsby project from version ^2.32.0 to 4.25.9 or 5.13.7, and encountered an issue that only occurs in the production environment on Chrome.
Summary:
Issue Description: After redeploying to the production environment, the layout component used in wrapPageElement or wrapRootElement remounts on page navigation when using navigate or Link.
Conditions:
The issue only occurs on Chrome.
The issue disappears if I disable the browser cache in Chrome DevTools.
The issue disappears if I change cache setting to no-store on Firebase hosting
The issue only appears after redeploying to production. It does not occur when the app is opened for the first time or when using an incognito window.
No issue was observed in version ^2.32.0, but it started appearing after upgrading to 4.25.9 or 5.13.7.
The issue does not occur on Safari and Firefox.
Previous Attempts: I've attempted to use wrapRootElement and changed navigate to Link, as recommended in issue #16489, but the issue persists.
Reproduction Link
Unfortunately, I cannot provide a reproduction link as the issue only occurs after redeploying to production.
Steps to Reproduce
First Screenshot: Shows the network tab in Chrome, highlighting the repeated request of app-xxx.js when cache is enabled.
Second Screenshot: Shows the same page when cache is disabled — the repeated request does not occur.
Expected Result
The layout component should not remount when navigating to a new page after redeploying the app to production.
Actual Result
The layout component remounts when navigating to a new page after redeploying the app to production, only on Chrome.
Environment
Gatsby Version: 4.25.9 Hosting: Firebase Hosting OS and Browser: macOS (Chrome only) Caching: Disabling cache in Chrome removes the issue.
Config Flags
The text was updated successfully, but these errors were encountered: