dvc.org: yarn: lots of errors when running dev app; can't test locally

This is on master branch just now. I’m on windows though. I run yarn and then:

UPDATE: Jump to https://github.com/iterative/dvc.org/issues/1100#issuecomment-608704285

λ yarn develop
yarn run v1.22.4
$ gatsby develop
success open and validate gatsby-configs - 0.642s
success load plugins - 1.489s
success onPreInit - 0.021s
success initialize cache - 0.015s
success copy gatsby files - 0.288s
success onPreBootstrap - 0.014s
success createSchemaCustomization - 0.341s
success source and transform nodes - 0.539s
success building schema - 0.454s

 ERROR #85923  GRAPHQL

There was an error in your GraphQL query:

Cannot query field "fields" on type "MarkdownRemark".

If you don't expect "fields" to exist on the type "MarkdownRemark" it is most likely a typo.
However, if you expect "fields" to exist there are a couple of solutions to common problems:

- If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server - The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
- You want to optionally use your field "fields" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content")

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "MarkdownRemark":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions

File: gatsby-node.js:66:24


 ERROR #11321  PLUGIN

"gatsby-node.js" threw an error while running the createPages lifecycle:

Cannot query field "fields" on type "MarkdownRemark".



  GraphQLError: Cannot query field "fields" on type "MarkdownRemark".

  - graphql-runner.js:53 GraphQLRunner.validate
    [dvc.org]/[gatsby]/dist/query/graphql-runner.js:53:44

  - graphql-runner.js:78 GraphQLRunner.query
    [dvc.org]/[gatsby]/dist/query/graphql-runner.js:78:25

  - graphql-runner.js:21
    [dvc.org]/[gatsby]/dist/bootstrap/graphql-runner.js:21:37

  - gatsby-node.js:66 Object.exports.createPages
    C:/Users/poj12/dvc.org/gatsby-node.js:66:24

  - api-runner-node.js:256 runAPI
    [dvc.org]/[gatsby]/dist/utils/api-runner-node.js:256:37

  - api-runner-node.js:375 Promise.catch.decorateEvent.pluginName
    [dvc.org]/[gatsby]/dist/utils/api-runner-node.js:375:15

  - debuggability.js:384 Promise._execute
    [dvc.org]/[bluebird]/js/release/debuggability.js:384:9

  - promise.js:518 Promise._resolveFromExecutor
    [dvc.org]/[bluebird]/js/release/promise.js:518:18

  - promise.js:103 new Promise
    [dvc.org]/[bluebird]/js/release/promise.js:103:10

  - api-runner-node.js:374
    [dvc.org]/[gatsby]/dist/utils/api-runner-node.js:374:12

  - util.js:16 tryCatcher
    [dvc.org]/[bluebird]/js/release/util.js:16:23


failed createPages - 0.203s
success createPagesStatefully - 0.257s
success onPreExtractQueries - 0.004s
success update schema - 0.062s

 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown argument "fields" on field "markdownRemark" of type "Query".

GraphQL request:3:26
2 |   query DocPageBySlug($slug: String!) {
3 |     page: markdownRemark(fields: { slug: { eq: $slug } }) {
  |                          ^
4 |       htmlAst

File: src\templates\doc.js:36:26

failed extract queries from components - 0.503s
success write out requires - 0.162s
success write out redirect data - 0.039s
success Build manifest and related icons - 0.120s
success onPostBootstrap - 0.176s
⠀
info bootstrap finished - 10.463 s
⠀
success run queries - 0.225s - 7/7 31.11/s


——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————7 pages                                                             In Progress                                                            website

What am I doing wrong?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (22 by maintainers)

Most upvoted comments

Yeah never mind about that, I think it was my bad. node_modules.wsl was a backup I made of the node mods dir created from WSL 😋

@jorgeorpinel I found reason! Fix here fix-fields-on-windows. Can you try it copy manually and confirm that all works fine now while it’s not merged?

@jorgeorpinel from the error text I can understand that it cant find these fields: https://github.com/iterative/dvc.org/blob/master/gatsby-node.js#L76-L78

We add them before at https://github.com/iterative/dvc.org/blob/master/gatsby-node.js#L53-L57

onCreateNode runs before createPage so you should have them already. Question is why they don’t exists. Just to be sure that this is not a cache problem, can you try to remove .cache folder?

@pavelgrinchenko If this is not a cache problem, can you take a look at it too?