Closed vai0 closed 4 years ago
Error when running gatsby develop with a fresh new gatsby project.
gatsby develop
ERROR #11321 PLUGIN "gatsby-source-apiserver" threw an error while running the sourceNodes lifecycle: Cannot read property 'data' of undefined TypeError: Cannot read property 'data' of undefined - fetch.js:91 [gatsby-incremental-builds]/[gatsby-source-apiserver]/fetch.js:91:80 - Generator.throw - fetch.js:127 step [gatsby-incremental-builds]/[gatsby-source-apiserver]/fetch.js:127:191 - fetch.js:127 [gatsby-incremental-builds]/[gatsby-source-apiserver]/fetch.js:127:402 - next_tick.js:68 process._tickCallback internal/process/next_tick.js:68:7 - From previous event: - api-runner-node.js:261 runAPI [gatsby-incremental-builds]/[gatsby]/dist/utils/api-runner-node.js:261:22 - api-runner-node.js:378 resolve [gatsby-incremental-builds]/[gatsby]/dist/utils/api-runner-node.js:378:15 - From previous event: - api-runner-node.js:377 Promise.mapSeries.plugin [gatsby-incremental-builds]/[gatsby]/dist/utils/api-runner-node.js:377:12 - From previous event: - api-runner-node.js:371 resolve [gatsby-incremental-builds]/[gatsby]/dist/utils/api-runner-node.js:371:11 - From previous event: - api-runner-node.js:278 module.exports [gatsby-incremental-builds]/[gatsby]/dist/utils/api-runner-node.js:278:12 - source-nodes.js:88 _default [gatsby-incremental-builds]/[gatsby]/dist/utils/source-nodes.js:88:36 - source-nodes.js:29 sourceNodes [gatsby-incremental-builds]/[gatsby]/dist/services/source-nodes.js:29:34 - index.js:29 bootstrap [gatsby-incremental-builds]/[gatsby]/dist/bootstrap/index.js:29:35 warn The gatsby-source-apiserver plugin has generated no Gatsby nodes. Do you need it?
gatsby new test-project npm i -S -E gatsby-source-apiserver // update gatsby-config.js to match the one below gatsby develop
gatsby-config.js
module.exports = { siteMetadata: { title: `...`, description: `...`, author: `@gatsbyjs`, }, plugins: [ { resolve: "gatsby-source-apiserver", options: { typePrefix: "internal__", url: `https://jsonplaceholder.typicode.com/todos/1`, name: `todods`, }, }, `gatsby-plugin-react-helmet`, { resolve: `gatsby-source-filesystem`, options: { name: `images`, path: `${__dirname}/src/images`, }, }, `gatsby-transformer-sharp`, `gatsby-plugin-sharp`, ], }
package.json
{ "name": "gatsby-starter-default", "private": true, "description": "A simple starter to get up and developing quickly with Gatsby", "version": "0.1.0", "author": "Kyle Mathews <mathews.kyle@gmail.com>", "dependencies": { "gatsby": "^2.23.12", "gatsby-image": "^2.4.9", "gatsby-plugin-manifest": "^2.4.14", "gatsby-plugin-offline": "^3.2.13", "gatsby-plugin-react-helmet": "^3.3.6", "gatsby-plugin-sharp": "^2.6.14", "gatsby-source-apiserver": "2.1.6", "gatsby-source-filesystem": "^2.3.14", "gatsby-transformer-sharp": "^2.5.7", "prop-types": "^15.7.2", "react": "^16.12.0", "react-dom": "^16.12.0", "react-helmet": "^6.1.0" }, "devDependencies": { "prettier": "2.0.5" }, "keywords": [ "gatsby" ], "license": "0BSD", "scripts": { "build": "gatsby build", "develop": "gatsby develop", "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"", "start": "npm run develop", "serve": "gatsby serve", "clean": "gatsby clean", "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1" }, "repository": { "type": "git", "url": "https://github.com/gatsbyjs/gatsby-starter-default" }, "bugs": { "url": "https://github.com/gatsbyjs/gatsby/issues" } }
pls try again with v2.1.7?
think that works now, thanks!
Summary
Error when running
gatsby develop
with a fresh new gatsby project.Steps to reproduce
Relevant Info
gatsby-config.js
package.json