Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQLError: Cannot query field "name" on type "frontmatter" #5

Closed
IgorPropisnov opened this issue Jan 14, 2019 · 3 comments
Closed

Comments

@IgorPropisnov
Copy link

IgorPropisnov commented Jan 14, 2019

I have follow all the documented steps and gets the following error on npm run develop

Error:

[ { GraphQLError: Cannot query field "name" on type "frontmatter".
message: 'Cannot query field "name" on type "frontmatter".',
    locations: [ [Object] ],
    path: undefined 
},
{ GraphQLError: Cannot query field "menu" on type "frontmatter".
message: 'Cannot query field "menu" on type "frontmatter".',
    locations: [ [Object] ],
    path: undefined 
} ]

And this:

TypeError: Cannot read property 'allMdx' of undefined

  - gatsby-node.js:46 graphql.then.result
    /my/path/to/docs/gatsby-documentation-starter/gatsby-node.js:46:21

  - util.js:16 tryCatcher
    [gatsby-documentation-starter]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [gatsby-documentation-starter]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [gatsby-documentation-starter]/[bluebird]/js/release/promise.js:569:18

  - promise.js:606 Promise._settlePromiseCtx
    [gatsby-documentation-starter]/[bluebird]/js/release/promise.js:606:10

  - async.js:142 _drainQueueStep
    [gatsby-documentation-starter]/[bluebird]/js/release/async.js:142:12

  - async.js:131 _drainQueue
    [gatsby-documentation-starter]/[bluebird]/js/release/async.js:131:9

  - async.js:147 Async._drainQueues
    [gatsby-documentation-starter]/[bluebird]/js/release/async.js:147:5

  - async.js:17 Immediate.Async.drainQueues [as _onImmediate]
    [gatsby-documentation-starter]/[bluebird]/js/release/async.js:17:14


error Cannot read property 'filter' of undefined


  TypeError: Cannot read property 'filter' of undefined

  - api-runner-node.js:274 Promise.mapSeries.catch.then.results
    [gatsby-documentation-starter]/[gatsby]/dist/utils/api-runner-node.js:274:42

  - util.js:16 tryCatcher
    [gatsby-documentation-starter]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [gatsby-documentation-starter]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [gatsby-documentation-starter]/[bluebird]/js/release/promise.js:569:18

  - promise.js:614 Promise._settlePromise0
    [gatsby-documentation-starter]/[bluebird]/js/release/promise.js:614:10

  - promise.js:694 Promise._settlePromises
    [gatsby-documentation-starter]/[bluebird]/js/release/promise.js:694:18

  - async.js:138 _drainQueueStep
    [gatsby-documentation-starter]/[bluebird]/js/release/async.js:138:12

  - async.js:131 _drainQueue
    [gatsby-documentation-starter]/[bluebird]/js/release/async.js:131:9

  - async.js:147 Async._drainQueues
    [gatsby-documentation-starter]/[bluebird]/js/release/async.js:147:5

  - async.js:17 Immediate.Async.drainQueues [as _onImmediate]
    [gatsby-documentation-starter]/[bluebird]/js/release/async.js:17:14


error UNHANDLED REJECTION


  TypeError: Cannot read property 'filter' of undefined

  - api-runner-node.js:274 Promise.mapSeries.catch.then.results
    [gatsby-documentation-starter]/[gatsby]/dist/utils/api-runner-node.js:274:42

  - util.js:16 tryCatcher
    [gatsby-documentation-starter]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [gatsby-documentation-starter]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [gatsby-documentation-starter]/[bluebird]/js/release/promise.js:569:18

  - promise.js:614 Promise._settlePromise0
    [gatsby-documentation-starter]/[bluebird]/js/release/promise.js:614:10

  - promise.js:694 Promise._settlePromises
    [gatsby-documentation-starter]/[bluebird]/js/release/promise.js:694:18

  - async.js:138 _drainQueueStep
    [gatsby-documentation-starter]/[bluebird]/js/release/async.js:138:12

  - async.js:131 _drainQueue
    [gatsby-documentation-starter]/[bluebird]/js/release/async.js:131:9

  - async.js:147 Async._drainQueues
    [gatsby-documentation-starter]/[bluebird]/js/release/async.js:147:5

  - async.js:17 Immediate.Async.drainQueues [as _onImmediate]
    [gatsby-documentation-starter]/[bluebird]/js/release/async.js:17:14

My debug-log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/11.6.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'develop' ]
2 info using npm@6.5.0
3 info using node@v11.6.0
4 verbose run-script [ 'predevelop', 'develop', 'postdevelop' ]
5 info lifecycle gatsby-documentation-starter@1.0.0~predevelop: gatsby-documentation-starter@1.0.0
6 info lifecycle gatsby-documentation-starter@1.0.0~develop: gatsby-documentation-starter@1.0.0
7 verbose lifecycle gatsby-documentation-starter@1.0.0~develop: unsafe-perm in lifecycle true
8 verbose lifecycle gatsby-documentation-starter@1.0.0~develop: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/my/path/to/project/docs/gatsby-documentation-starter/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle gatsby-documentation-starter@1.0.0~develop: CWD: /my/path/to/project/docs/gatsby-documentation-starter
10 silly lifecycle gatsby-documentation-starter@1.0.0~develop: Args: [ '-c', 'gatsby develop' ]
11 silly lifecycle gatsby-documentation-starter@1.0.0~develop: Returned: code: 1  signal: null
12 info lifecycle gatsby-documentation-starter@1.0.0~develop: Failed to exec develop script
13 verbose stack Error: gatsby-documentation-starter@1.0.0 develop: `gatsby develop`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:188:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:188:13)
13 verbose stack     at maybeClose (internal/child_process.js:978:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid gatsby-documentation-starter@1.0.0
15 verbose cwd /my/path/to/project/docs/gatsby-documentation-starter
16 verbose Darwin 18.2.0
17 verbose argv "/usr/local/Cellar/node/11.6.0/bin/node" "/usr/local/bin/npm" "run" "develop"
18 verbose node v11.6.0
19 verbose npm  v6.5.0
20 error code ELIFECYCLE
21 error errno 1
22 error gatsby-documentation-starter@1.0.0 develop: `gatsby develop`
22 error Exit status 1
23 error Failed at the gatsby-documentation-starter@1.0.0 develop script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Is there a minimum node version required for this?

Thanks!

@sabarishreddy
Copy link

i do face the same error, did it got resolved for you?

@adbarnes
Copy link

I'm also having the same problem, has this starter been abandoned?

@whoisryosuke
Copy link
Owner

@Pommesloch @sabarishreddy @adbarnes

You have to add frontmatter to your MDX files. It's where the theme derives the page/component title from, as well as the category/menu it's grouped under in the sidebar.

From the README:

In order for your component data to show up, you need an MDX file for the component - and the page name and component name in the docblock need to match.

/**
 * ComponentTitle
**/
class ComponentName extends React.Component {}
---
name: ComponentTitle
menu: CategoryName
---

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants