Gatsby: Bug: Gatsby netlify-cms can't access admin screen on latest version

Created on 10 Mar 2019  路  5Comments  路  Source: gatsbyjs/gatsby

Summary

Hi guys, I need some help. I'am new to gatsby and the static world. I was following the gatsby/netlify-cms tutorial and I'm stuck early on.
When I run "npm start" everything runs correctly, I get the message that netlify-cms is running on localhost:8000/admin/ and the admin files are properly generated in the public/admin folder.
but when I hit the url, I get a 404.
I can only access the admin screen if I run gatsby build and gatsby serve.
running on (windows) the latest version of gatsby, gatsby-plugin-netlify-cms, netlify-cms.
Thank you

Relevant information

File contents (if changed)

gatsby-config.js:

backend:
  name: test-repo

media_folder: static/assets
public_folder: assets

collections:
  - name: blog
    label: Blog
    folder: blog
    create: true
    fields:
      - { name: path, label: Path }
      - { name: date, label: Date, widget: date }
      - { name: title, label: Title }
      - { name: body, label: Body, widget: markdown }

package.json:

   "gatsby": "^2.1.27",
    "gatsby-plugin-netlify-cms": "^3.0.12",
    "netlify-cms": "^2.6.0",
    "react": "^16.8.4",
    "react-dom": "^16.8.4"`

bug

Most helpful comment

Update

I tested with this npm packages:

 "gatsby": "2.0.0",
    "gatsby-plugin-netlify-cms": "^3.0.12",
    "netlify-cms": "^2.6.0",
    "react": "^16.8.4",
    "react-dom": "^16.8.4"

and It worked, I can access the admin page when running in dev mode so this is definitely a bug.

Update 2
It seems that the bug has been introduced with the 2.1.23 version of Gatsby. Prior to this version it works properly.

All 5 comments

Update

I tested with this npm packages:

 "gatsby": "2.0.0",
    "gatsby-plugin-netlify-cms": "^3.0.12",
    "netlify-cms": "^2.6.0",
    "react": "^16.8.4",
    "react-dom": "^16.8.4"

and It worked, I can access the admin page when running in dev mode so this is definitely a bug.

Update 2
It seems that the bug has been introduced with the 2.1.23 version of Gatsby. Prior to this version it works properly.

Can confirm this just happened to me while updating dependencies - 2.1.22 works :) Thank you @Mustaflex

We recently disallowed loading html during development https://github.com/gatsbyjs/gatsby/pull/12243

Netlify CMS is the only tool I know of with this pattern of loading another app during development. Which we didn't think about while making this change :-/

Options are plugins spinning up another server on a different port for serving their apps or we could add an API for plugins to set routes like this as exceptions.

Options are plugins spinning up another server on a different port for serving their apps or we could add an API for plugins to set routes like this as exceptions.

We expose express app via onCreateDevServer, so (at least temporarily) we can patch gatsby-plugin-netlify-cms to use that

Fixed and published in [email protected]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brandonmp picture brandonmp  路  3Comments

jimfilippou picture jimfilippou  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

signalwerk picture signalwerk  路  3Comments

totsteps picture totsteps  路  3Comments