Second build doesn't update MediaNode links in HTML #39204
Description
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
Description
Hi,
We're using Gatsby v3 with gatsby-source-wordpress@latest-v3.
We're running into one issue where MediaItems are not correctly resolved to local and referenced to wordpress only, and this happens only for 1 page, and for subsequent builds. first build works fine, but the second and onwards doesn't update media items correctly.
Due to company I cannot share much details but would like some help on how to debug this,
Page link on production - https://tech.phonepe.com/all-an-sre-needs-to-know-automation-era-in-distributed-datastores/
In the cache file for this page .cache/json/_all-an-sre-needs-to-know-automation-era-in-distributed-datastores_.json
I saw this for first and second build
data.post.content
As seen here, first build refers images from local static folder, and second resolves to my wordpress host, which is unexpected.
I believe this is some parsing issue in gatsby or gatsby-source-wordpress. I have tried many things to debug and see which piece of code writes to this file, but to no success.
I'd like to know the piece of code that writes to this .cache/json/.json so that I can backtrace this.
Reproduction Link
https://example.com/cannot-share-since-it-is-internal
Steps to Reproduce
NA
Expected Result
Final page should have referred images from local only.
Actual Result
Final page is referring images from wordpress host, and not resolving to local.
Environment
System:
OS: macOS 14.6.1
CPU: (10) arm64 Apple M1 Pro
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.20.5 - ~/.nvm/versions/node/v18.20.5/bin/node
Yarn: 1.22.21 - ~/.nvm/versions/node/v20.10.0/bin/yarn
npm: 10.8.2 - ~/.nvm/versions/node/v18.20.5/bin/npm
Languages:
Python: 3.10.13 - /Users/ankur.parihar/.pyenv/shims/python
Browsers:
Chrome: 131.0.6778.205
Edge: 131.0.2903.112
Safari: 18.2
Config Flags
no config flags used