Gatsby preview integration guide

We are very proud that Gatsby has decided to feature this guide on how to integrate with DatoCMS: https://www.gatsbyjs.com/docs/getting-started-with-gatsby-preview-and-dato-cms/

We are also working together to improve the workflow and smooth out some rough edges.

Feel free to ask for more details, leave questions or ask for help!

Hi there, I seem to be having some issues getting preview to work. I’ve setup Gatsby Cloud and run through the automated integration with Dato. Builds seem to trigger correctly, the preview link generated updates with live data very quickly. All things appear to be working correctly apart from the CMS preview button plugin (https://github.com/gatsby-inc/datocms-plugin-gatsby-cloud) which doesn’t respond. Click it and I get nothing… any thoughts? I have a slug field present on all models that relate to pages. Can’t seem to find any useful information on the issue.

There is an error in the terminal when I click the link: Uncaught (in promise) TypeError: e.startsWith is not a function (https://unpkg.com/datocms-plugin-gatsby-cloud@0.1.6/dist/bundle.js)

I’m using chrome canary: Version 82.0.4084.0 (Official Build) canary (64-bit)

hello @jacobc and welcome to Community!!

Have you tried getting in touch with them? Maybe you can open an issue on the plugin repo to ask what they think about this? Sorry not being more helpful here, but this might be the fastest way to solve your issue.

Thanks Matteo, not yet. Will raise an issue with the Gatsby team on github. Thanks

1 Like

Hi there,
We have been having an issue with Gatsby Preview on DatoCMS, and we have configured two languages (EN and DE). However, for pages that only have content in English, DE (German) appears as the default environment when we are previewing the page.
This happens on all pages, also pages that have content in both languages, but I am just focusing the English content, still the preview shows up with DE as language.

It only happens when clicking the “open preview” button from DatoCMS.
If we access to the preview page from a link, works fine by showing the expected language.

Please, any idea about why is this happening? Thanks in advance.

hey @lpc I’ve seen that you have created an issue here: Why does the preview default to DE · Issue #58 · gatsby-inc/datocms-plugin-gatsby-cloud · GitHub

I think that’s the right place to address this problem as it looks like the plugin doesn’t take into consideration the locale that you are seeing to open the preview link.

Let’s keep an eye on the issue. If nothing happens there let me know and I’ll try pushing as well.

1 Like