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.

ERROR #95313 Building static HTML failed for path "/products/some-link"

See original GitHub issue

Description

I’m trying to deploy project using Vercel but getting this error. I’m using createPages function for each product from Stripe and passing product to template where is error ‘TypeError: Cannot read property ‘product’ of undefined’. Everything works as expected in dev mode but not in production Describe the issue that you’re seeing.

Steps to reproduce

Don’t know right now

Expected result

Project should be deployed without errors.

Actual result

ERROR #95313

Environment

System: OS: macOS 10.15.4 CPU: (4) x64 Intel® Core™ i5-7360U CPU @ 2.30GHz Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.14.0 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.5 - /usr/local/bin/npm Languages: Python: 2.7.16 - /usr/bin/python Browsers: Chrome: 81.0.4044.138 Firefox: 76.0.1 Safari: 13.1 npmPackages: gatsby: ^2.21.13 => 2.21.15 gatsby-cli: ^2.12.29 => 2.12.29 gatsby-image: ^2.4.1 => 2.4.2 gatsby-plugin-apollo: ^3.0.1 => 3.0.1 gatsby-plugin-manifest: ^2.4.2 => 2.4.2 gatsby-plugin-offline: ^3.2.1 => 3.2.1 gatsby-plugin-react-helmet: ^3.3.1 => 3.3.1 gatsby-plugin-react-redux: ^1.1.0-0 => 1.1.0-0 gatsby-plugin-sharp: ^2.6.1 => 2.6.1 gatsby-plugin-styled-components: ^3.3.1 => 3.3.1 gatsby-plugin-transition-link: ^1.18.0 => 1.18.0 gatsby-source-filesystem: ^2.3.1 => 2.3.1 gatsby-source-stripe: ^3.0.7 => 3.0.7 gatsby-transformer-sharp: ^2.5.1 => 2.5.1 npmGlobalPackages: gatsby-cli: 2.12.1

Run gatsby info --clipboard in your project directory and paste the output here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
ascorbiccommented, May 21, 2020

Hi!

Sorry to hear you’re running into an issue. Error 95313 just means that the HTML could not be built, which is goign to be down to a React error of some type. In this case it probably means that you have no product on that page. To stop the error immediately, add a null check for the object that is supposed to contain product. e.g:


export const MyComponent = ({ data }) => {
  if(!data) return null
 return <Something product={data.product} />
}

To help us best begin debugging the underlying cause, it would be really helpful if you’re able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

Thanks!

0reactions
alibalbarscommented, Jan 5, 2022

Hi!

Sorry to hear you’re running into an issue. Error 95313 just means that the HTML could not be built, which is goign to be down to a React error of some type. In this case it probably means that you have no product on that page. To stop the error immediately, add a null check for the object that is supposed to contain product. e.g:

export const MyComponent = ({ data }) => {
  if(!data) return null
 return <Something product={data.product} />
}

To help us best begin debugging the underlying cause, it would be really helpful if you’re able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

Thanks!

It solved my error, thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby build error 95313 - Project not building - Stack Overflow
Building error in Gatsby ERROR #95313. Building static HTML failed for path "/components/settings/". The component that's giving error while ...
Read more >
Building static HTML failed for path - Developing with Prismic
Hello, we have an issue with gatsby build. The issue only happens with gatsby build, gatsby develop is working fine. The error starts...
Read more >
[Gatsby] Building static HTML failed for path - Support
There is an error when trying to build the website, the weird thing is that this is only happening in netlify, when I...
Read more >
Help resolving TypeError using FlexSearch in Gatsby - Reddit
ERROR Page data from page-data.json for the failed page ... 0.424s ERROR #95313 Building static HTML failed for path "/Search/" See our docs ......
Read more >
Debugging HTML Builds | Gatsby
Errors while building static HTML files (the build-time React SSR ... Some other reason :-) #1 is the most common reason building static...
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