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

GraphQL query error since gatsby-transformer-remark 2.7.4 release #23426

Closed
mabhub opened this issue Apr 23, 2020 · 6 comments
Closed

GraphQL query error since gatsby-transformer-remark 2.7.4 release #23426

mabhub opened this issue Apr 23, 2020 · 6 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@mabhub
Copy link
Contributor

mabhub commented Apr 23, 2020

Description

Build fail when gatsby-transformer-remark is upgraded (from either 2.6.59 or 2.7.3) to 2.7.4

(Issue may be related to 82c05aa)

Steps to reproduce

As the issue seems to rely on async processing and depending on amount of GraphQL nodes to process, I wasn't able to create a minimal reproduction test case. But the project I'm working on is open source, so you may reproduce the error with it:
Build may take several minute to complete

$ git clone --branch test-case --depth=1 https://github.com/solagro/awa.git
$ cd awa
$ npm ci && npm run build
$ # Build success

$ npm i gatsby-transformer-remark@2.7.4
$ npm run clean && npm run build
$ # Build fail

Expected result

Successfull build

Actual result

Build error

image

[...]

success onPostBootstrap - 0.009s
info bootstrap finished - 17.681 s
success Building production JavaScript and CSS bundles - 55.534s
success Rewriting compilation hashes - 0.007s

 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Expected node, not `[object Object]`

   1 | query tmpawasrccomponentsClimateObservationsJs3511084170($gridCode: String, $sourceType: String, $language: String) {
   2 |   allGridPointData(filter: {gridCode: {eq: $gridCode}, sourceType: {eq: $sourceType}}, sort: {fields: [gridCode, dataType]}) {
   3 |     nodes {
   4 |       dataType
   5 |       json
   6 |     }
   7 |   }
   8 |   allTexts: allMarkdownRemark(sort: {fields: fileAbsolutePath}, filter: {frontmatter: {sourceType: {eq: $sourceType}, locale: {eq: $language}}}) {
   9 |     nodes {
> 10 |       html
     |       ^
  11 |       frontmatter {
  12 |         dataType
  13 |       }
  14 |     }
  15 |   }
  16 | }
  17 |

File path: /tmp/awa/src/components/ClimateObservations.js
Url path: /en/map/100132/climate-observations
Plugin: none


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Expected node, not `[object Object]`

   1 | query tmpawasrccomponentsClimateObservationsJs3511084170($gridCode: String, $sourceType: String, $language: String) {
   2 |   allGridPointData(filter: {gridCode: {eq: $gridCode}, sourceType: {eq: $sourceType}}, sort: {fields: [gridCode, dataType]}) {
   3 |     nodes {
   4 |       dataType
   5 |       json
   6 |     }
   7 |   }
   8 |   allTexts: allMarkdownRemark(sort: {fields: fileAbsolutePath}, filter: {frontmatter: {sourceType: {eq: $sourceType}, locale: {eq: $language}}}) {
   9 |     nodes {
> 10 |       html
     |       ^
  11 |       frontmatter {
  12 |         dataType
  13 |       }
  14 |     }
  15 |   }
  16 | }
  17 |

File path: /tmp/awa/src/components/ClimateObservations.js
Url path: /en/map/100132/climate-observations
Plugin: none

not finished run queries - 67.894s

Environment

  System:
    OS: Linux 5.4 Ubuntu 20.04 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 12.16.2 - ~/.nvm/versions/node/v12.16.2/bin/node
    npm: 6.14.4 - ~/.nvm/versions/node/v12.16.2/bin/npm
  Languages:
    Python: 2.7.18 - /usr/bin/python
  Browsers:
    Firefox: 76.0b7
  npmPackages:
    gatsby: ~2.20.29 => 2.20.29
    gatsby-image: ~2.3.4 => 2.3.4
    gatsby-plugin-google-analytics: ~2.2.4 => 2.2.4
    gatsby-plugin-manifest: ~2.3.6 => 2.3.6
    gatsby-plugin-material-ui: ~2.1.6 => 2.1.6
    gatsby-plugin-modal-routing: ^1.1.0 => 1.1.0
    gatsby-plugin-netlify: ~2.2.3 => 2.2.3
    gatsby-plugin-netlify-cms: ~4.2.4 => 4.2.4
    gatsby-plugin-offline: ~3.1.4 => 3.1.4
    gatsby-plugin-react-helmet: ~3.2.4 => 3.2.4
    gatsby-plugin-remove-serviceworker: ~1.0.0 => 1.0.0
    gatsby-plugin-robots-txt: ~1.5.0 => 1.5.0
    gatsby-plugin-sharp: ~2.5.6 => 2.5.6
    gatsby-plugin-sitemap: ~2.3.5 => 2.3.5
    gatsby-plugin-uninline-styles: ~0.2.0 => 0.2.0
    gatsby-plugin-web-font-loader: ~1.0.4 => 1.0.4
    gatsby-remark-external-links: 0.0.4 => 0.0.4
    gatsby-source-filesystem: ~2.2.4 => 2.2.4
    gatsby-transformer-json: ~2.3.3 => 2.3.3
    gatsby-transformer-remark: ~2.7.4 => 2.7.4
    gatsby-transformer-sharp: ~2.4.6 => 2.4.6
  npmGlobalPackages:
    gatsby-transformer-remark: 2.7.4
    gatsby: 2.20.27
@mabhub mabhub added the type: bug An issue or pull request relating to a bug in Gatsby label Apr 23, 2020
@pieh
Copy link
Contributor

pieh commented Apr 23, 2020

I can definitely reproduce, but it seems unreasonably difficult to debug what exactly is happening - for some reason attaching debugger makes the problem not reproducible anymore

@pieh pieh added the status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. label Apr 23, 2020
@pieh
Copy link
Contributor

pieh commented Apr 23, 2020

Adding at least stack trace of where the error happens:

Expected node, not `[object Object]`



  Error: Expected node, not `[object Object]`
  
  - one.js:21 one
    [i23426]/[hast-util-to-html]/lib/one.js:21:11
  
  - index.js:28 toHTML
    [i23426]/[hast-util-to-html]/lib/index.js:28:10
  
  - extend-node-type.js:369 getHTML
    [i23426]/[gatsby-transformer-remark]/extend-node-type.js:369:22
  
  - next_tick.js:68 process._tickCallback
    internal/process/next_tick.js:68:7

More to follow

@pieh
Copy link
Contributor

pieh commented Apr 23, 2020

Ah, seems like this was already discovered ( #21188 (comment) ) and fixed ( #23427 ) in master, but not yet published to npm. I will publish this tomorrow (finishing for today)

@pieh
Copy link
Contributor

pieh commented Apr 23, 2020

So for today, please pin to previous gatsby-transformer-remark, and next publish should fix this as well.

I applied same fix from #23427 locally and couldn't reproduce the problem anymore.

@github-actions
Copy link

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label May 14, 2020
@github-actions
Copy link

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 💪💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

2 participants