Skip to content

Incremental build not working with React.lazy loaded component when a gatsby-config file exists #37706

Closed
@joiglifberg

Description

@joiglifberg

Preliminary Checks

Description

Gatsby does not update a page with Incremental build when a change in a component imported with React.lazy AND a gatsby-config file exists.

The first video displays when a gatsby-config exist and therefore it's not working.
In the second video, the gatsby-config file is deleted and the change in the React.lazy loaded component is detected and the page updated.

Screen.Recording.2023-02-27.at.14.28.31.mp4
Screen.Recording.2023-02-27.at.14.30.45.mp4

Reproduction Link

https://github.com/joiglifberg/gatsby-incremental-build-react-lazy-gatsby-config-reproduction

Steps to Reproduce

  1. Download the repo
  2. Run npx gatsby build --log-pages.
    Updated page: / is displayed.
  3. Make a change in the component src/MyComponent.js
  4. Run npx gatsby build --log-pages.
    There are no new or changed html files to build. is displayed.

Expected Result

I expect the page / to have been updated and the console output to be Updated page: /

Actual Result

The page / has not been updated and the console output is There are no new or changed html files to build.

Environment

System:
    OS: macOS 13.2
    CPU: (10) arm64 Apple M1 Pro
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.14.2 - ~/.nvm/versions/node/v18.14.2/bin/node
    npm: 9.5.0 - ~/.nvm/versions/node/v18.14.2/bin/npm
  Browsers:
    Safari: 16.3
  npmPackages:
    gatsby: ^5.7.0 => 5.7.0

Config Flags

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: confirmedIssue with steps to reproduce the bug that’s been verified by at least one reviewer.type: bugAn issue or pull request relating to a bug in Gatsby

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions