decap-cms icon indicating copy to clipboard operation
decap-cms copied to clipboard

Netlify CMS no longer works with Gatsby

Open mosesoak opened this issue 1 year ago • 0 comments

Describe the bug

The CMS cannot be used with Gatsby 4: Gatsby builds fail with null images. These are normal Netlify CMS uploads in the static directory.

To Reproduce

Please follow the steps listed at the Gatsby issue: https://github.com/gatsbyjs/gatsby/issues/36432 which also includes an example repo for easy bug replication

Expected behavior

Netlify CMS should continue to work with Gatsby

Screenshots

This shows Gatsby failing to target CMS-uploaded images in its /static directory which lives at the repo root. null-image-bug

Applicable Versions:

    "gatsby": "^4.21.1",
    "gatsby-plugin-image": "^2.21.0",
    "gatsby-plugin-netlify-cms": "^6.21.0",
    "gatsby-plugin-sharp": "^4.21.0",
    "gatsby-remark-images": "^6.21.0",
    "gatsby-remark-relative-images": "^2.0.2",
    "gatsby-source-filesystem": "^4.21.1",
    "gatsby-transformer-remark": "^5.21.0",
    "gatsby-transformer-sharp": "^4.21.0",
    "netlify-cms-app": "^2.15.72",
    "react": "^18.1.0",
    "react-dom": "^18.1.0"

Note that gatsby-remark-relative-images has been determined to be stale and was a patch for gatsby-plugin-netlify-cms which never sourced Netlify CMS correctly.

CMS configuration

These are the media settings:

media_folder: static/assets
public_folder: /assets

Uploaded images look like this in md frontmatter:

image: /assets/mouse-meme.jpg

Additional context

It looks like this project never really gained steam and is no longer actively maintained -- it has 700 issues and over 50 open PRs with little response from Netlify's team.

It's a sad tale of woe: Gatsby created a plugin for it 4 or 5 years ago that never really sourced images correctly which gave rise to a community patch plugin that's now gone stale.

It's too bad we used this on a production website! Now we can't upgrade anything.

mosesoak avatar Aug 30 '22 22:08 mosesoak