Skip to content

Second build doesn't update MediaNode links in HTML #39204

Open
@ankurparihar

Description

Preliminary Checks

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

Screenshot 2025-01-03 at 1 25 07 PM

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

Metadata

Assignees

No one assigned

    Labels

    status: triage neededIssue or pull request that need to be triaged and assigned to a reviewertype: 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