Gatsby build successfully locally, but fails in Netlify

I´m getting this error in the log:

failed Building static HTML for pages - 0.359s
1:42:38 PM: error Building static HTML failed for path "/computacion/"
1:42:38 PM: 
1:42:38 PM:   65 |   const topicInfo = data.allTopicsJson.edges.filter(({ node }) => {
1:42:38 PM:   66 |     return node.slug === topic.toLowerCase().replace(" ", "-")
1:42:38 PM: > 67 |   })[0].node
1:42:38 PM:      |         ^
1:42:38 PM:   68 |
1:42:38 PM:   69 |   return (
1:42:38 PM:   70 |     <Layout pageType="Topic">
1:42:38 PM: 
1:42:38 PM:   WebpackError: TypeError: Cannot read property 'node' of undefined
1:42:38 PM:   
1:42:38 PM:   - topic-page.js:67 
1:42:38 PM:     src/templates/topic-page.js:67:9
1:42:38 PM:   
1:42:38 PM: 
1:42:38 PM: not finished Generating image thumbnails - 33.605s
1:42:38 PM: error Command failed with exit code 1.

I´m using this template: GitHub - peterdurham/gatsby-starter-blog-boost: Netlify CMS Powdered Blog Starter (Gatsby)

Hey there, @geosmina :wave:

Thanks for sharing this, and welcome to Netlify Forums! I recommend you take a look at this thread, as this community member encountered the same issue.

If following the steps in that thread don’t work, can you also share your Netlify site name as well as your custom domain name? Additionally, please share what steps you have already tried.

Thank you!

I actually solved it not using that piece of code at all, but thanks for the reply.

Thats great to hear! If you have time to share what you steps you took that solved your issue, that would be fantastic. :netlisparkles: Sharing solutions helps future Forums members who encounter something similar.