gatsby-plugin-react-i18next icon indicating copy to clipboard operation
gatsby-plugin-react-i18next copied to clipboard

Gatsby Build Fail

Open ldw510 opened this issue 2 years ago • 1 comments

Hello,

Running the plug-in on my local server fine. Everything works as it should.

However, when I go to push to Netlify using a build command I get these error codes:

:error Page data from page-data.json for the failed page

:failed Building static HTML for pages - 4.555s :error "document" is not available during server side rendering.

Any ideas what the problem is?

ldw510 avatar Jun 30 '22 14:06 ldw510

This is a common issue not related to this plugin. You'll want to put a check around each usage of the document object, like this

if (typeof document === 'undefined') {
 return;
}

When gatsby is preparing your items in the build process, the document is not available (as it is supplied by the browser and there is no mock document injected in the build process).

I hope that helps.

passion4code avatar Jul 11 '22 01:07 passion4code