algolia / gatsby-plugin-algolia

A plugin to push to Algolia based on graphQl queries
https://yarn.pm/gatsby-plugin-algolia
Apache License 2.0
178 stars 45 forks source link

Plugin breaking in Gatsby 5 #169

Closed yl92 closed 1 year ago

yl92 commented 1 year ago

Trying to upgrade our project to Gatsby 5 but encountered this error while making production builds:

failed to index to Algolia Cannot read properties of undefined (reading 'contentDigest')

Likely as a result of Gatsby 5's upgrading to GraphQL 16.

Haroenv commented 1 year ago

Have you used the latest version of the plugin, 1.0.2? If you have your configuration you can share, that would be good too!

yl92 commented 1 year ago

Thanks, just upgraded to 1.0.2 – didn't know that internal.contentDigest is required before this (it seemed like it was working fine without it). Thanks for sorting this!

Haroenv commented 1 year ago

No worries, that's a simplification and the breaking change of v1 to allow far less network requests and complexity needed in the plugin :)

chhourbro commented 1 year ago

1.0.2 works when you build locally but seems to be throwing the same error with Gatsby cloud builds.

Haroenv commented 1 year ago

You probably don't have the contentDigest in Gatsby cloud then. If you have a reproduction, please open a new issue :) @chhourbro