ERROR: Cannot read property 'replace' of undefined, onCreateNode, while using contentful cms #20560
Labels
status: needs more info
Needs triaging and reproducible examples or more information to be resolved
status: needs reproduction
This issue needs a simplified reproduction of the bug for further troubleshooting.
Description
Error msg:
I suspect that the errors are caused by onCreateNode in gatsby-node.js file. Because for some reasons I have 49 totalCount in allMarkdownRemark, while I only have 6 md files to create blog posts. Those extra files might come from contentful cms for some reason, they have sourceName and absolutepath as Null, but they do have internal.content, which are some filler text, which appear in some of my contentful data.
When I commented this out, together with blog templates and createPages for blog files, I no longer had the error msg. That's why I suspect it was caused by the those extra files (that is not from my md files) with a lot null fields.
Reference link:
Click here
Steps to reproduce
Almost impossible to reproduce unless you have exactly the same content as my contentful cms.
Expected result
can deploy to netlify.
Actual result
when I run gatsby develop, site is working correctly locally as expected despite the console has errors. And those errors are causing gatsby build to fail, so I can't deploy it.
Environment
System:
OS: Linux 5.0 Linux Mint 19.3 (Tricia)
CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
npm: 6.12.0 - ~/.nvm/versions/node/v12.13.0/bin/npm
Languages:
Python: 2.7.17 - /usr/bin/python
Browsers:
Chrome: 79.0.3945.117
Firefox: 72.0.1
npmPackages:
gatsby: ^2.18.8 => 2.18.11
gatsby-image: ^2.2.34 => 2.2.36
gatsby-plugin-commercelayer: ^1.2.10 => 1.2.10
gatsby-plugin-manifest: ^2.2.31 => 2.2.33
gatsby-plugin-offline: ^3.0.27 => 3.0.29
gatsby-plugin-react-helmet: ^3.1.16 => 3.1.18
gatsby-plugin-sharp: ^2.3.5 => 2.3.7
gatsby-plugin-snipcart: ^1.1.2 => 1.1.2
gatsby-remark-images: ^3.1.38 => 3.1.38
gatsby-remark-source-name: ^1.0.0 => 1.0.0
gatsby-source-contentful: ^2.1.76 => 2.1.76
gatsby-source-filesystem: ^2.1.40 => 2.1.42
gatsby-transformer-remark: ^2.6.42 => 2.6.42
gatsby-transformer-sharp: ^2.3.7 => 2.3.9
npmGlobalPackages:
gatsby-cli: 2.8.26
The text was updated successfully, but these errors were encountered: