question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[gatsby-source-filesystem] errors are ignored in createRemoteFileNode

See original GitHub issue

Took me a while to find a bug in my sourceNodes code, because errors are ignored in createRemoteFileNode inside processRemoteNode function.

I kept getting null back from createRemoteFileNode. So after some digging, I put a console.log directly into gatsby-source-filesystem inside my node_modules and see the error

error TypeError: createNodeId is not a function
    at /home/bojan/www/instaset/website/node_modules/gatsby-source-filesystem/create-file-node.js:61:11
    at Generator.next (<anonymous>)
    at step (/home/bojan/www/instaset/website/node_modules/@babel/runtime/helpers/asyncToGenerator.js:12:30)
    at _next (/home/bojan/www/instaset/website/node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:9)
    at run (/home/bojan/www/instaset/website/node_modules/core-js/library/modules/es6.promise.js:75:22)
    at /home/bojan/www/instaset/website/node_modules/core-js/library/modules/es6.promise.js:92:30
    at flush (/home/bojan/www/instaset/website/node_modules/core-js/library/modules/_microtask.js:18:9)
    at process._tickCallback (internal/process/next_tick.js:61:11)

Maybe we can do something about that?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
HriBBcommented, Jul 22, 2018

Hmm … I didn’t present this problem in a correct way 😃 I know about the new createNodeId parameter. But I made a mistake and imported it from actions instead of props

exports.sourceNodes = async ({ actions, store, cache }) => {
  const { createNode, createNodeId } = actions
  // ...
}

createRemoteFileNode kept returning null, and there was no error, because it is ignored. Is this intentional?

I already solved my problem, you can close this issue if you wish. Just wanted to point this out 😉

This is the right way to destructure props:

exports.sourceNodes = async ({ actions, createNodeId, store, cache }) => {
  const { createNode } = actions
  // ...
}
1reaction
KyleAMathewscommented, Jul 21, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

gatsby-source-filesystem
A Gatsby source plugin for sourcing data into your Gatsby application from your local filesystem. The plugin creates File nodes from files.
Read more >
How to use the gatsby-source-filesystem ... - Snyk
To help you get started, we've selected a few gatsby-source-filesystem.createRemoteFileNode examples, based on popular ways it is used in public projects.
Read more >
gatsby - How to create remote file node for contentful image
If I understand correctly, I have to use createRemoteFileNode from the gatsby-source-filesystem plugin. But I have a problem because I think ...
Read more >
gatsby-source-filesystem/README.md - UNPKG
3, A Gatsby source plugin for sourcing data into your Gatsby application. 4, from your local filesystem. 5. 6, The plugin creates `File`...
Read more >
Gatsby Changelog | 5.3.0
You might have run into an error like this while using Gatsby: ... Apprentice76: fix(gatsby-source-filesystem): Update createRemoteFileNode args PR #35422 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found