How to fix Error #10123 when I run gatsby develop for gatsby-starter-gcn?

Viewed 2746

I'm trying to use gatsby-starter-gcn to create a website. At this point I just want to be able to view the starter site locally so I can begin to make edits. But when I run gatsby develop I get the following error:

ERROR #10123  CONFIG

We encountered an error while trying to load your site's gatsby-config. Please fix the error and try again.



  Error: Contentful space ID and access token need to be provided.

  - gatsby-config.js:14 Object.<anonymous>
    C:/Windows/system32/gatsby-starter-gcn/gatsby-config.js:14:11

  - v8-compile-cache.js:178 Module._compile
    [gatsby-starter-gcn]/[v8-compile-cache]/v8-compile-cache.js:178:30

  - loader.js:1220 Object.Module._extensions..js
    internal/modules/cjs/loader.js:1220:10

  - loader.js:1049 Module.load
    internal/modules/cjs/loader.js:1049:32

  - loader.js:937 Function.Module._load
    internal/modules/cjs/loader.js:937:14

  - loader.js:1089 Module.require
    internal/modules/cjs/loader.js:1089:19

  - v8-compile-cache.js:159 require
    [gatsby-starter-gcn]/[v8-compile-cache]/v8-compile-cache.js:159:20

  - get-config-file.js:33 getConfigFile
    [gatsby-starter-gcn]/[gatsby]/dist/bootstrap/get-config-file.js:33:20

  - index.js:134 module.exports
    [gatsby-starter-gcn]/[gatsby]/dist/bootstrap/index.js:134:46

  - develop-process.js:433 module.exports
    [gatsby-starter-gcn]/[gatsby]/dist/commands/develop-process.js:433:36

  - task_queues.js:97 processTicksAndRejections
    internal/process/task_queues.js:97:5


not finished open and validate gatsby-configs - 0.052s

I tried to open the gatsby-config.js file in order to see the problem. I could open it in Notepad just fine, but Windows Script Host returned this error: Line: 1 Char: 5 Error: Expected ';' Code: 800A03EC Source: Microsoft JScript compilation error

I think if I can fix this compilation error in this file my problem will probably be fixed, but I haven't been able to figure out how, since I'm not terribly experienced with javascript. Here's a link to the file on GitHub: https://github.com/ryanwiemer/gatsby-starter-gcn/blob/master/gatsby-config.js

3 Answers

I believe you need an .env file with SPACE_ID and ACCESS_TOKEN at the root of your project.

The project requires a .contentful.json config file to be created in the root of the project. You can run npm run setup or yarn setup to have it walk you through the creation with you providing Contentful API key info. After that, running gatsby develop should work fine.

Related