craftcms / gatsby-source-craft

Gatsby source plugin for Craft CMS.
MIT License
54 stars 13 forks source link

changes are ignored when using multiple sites #53

Closed mmorkt closed 3 years ago

mmorkt commented 3 years ago

Using multiple sites: When changing an entry in Craft CMS. GatsbyJS dosn’t make the changes. I have to preform a "gatsby clean” to see my changes. Turn the extra site off and it will build.

@andris-sevcenko

Steps to reproduce

Additional info

andreasottosson commented 3 years ago

Related to https://github.com/craftcms/gatsby-helper/issues/16?

andris-sevcenko commented 3 years ago

Can you, please, share the plugin config for gatsby-source-craft and elaborate a little bit on which site is the primary?

Some more output would be also helpful - does Gatsby fail to see that nodes are updated? Does Craft tell Gatsby that the nodes are updated and then doesn't provide up-to-date information?

andreasottosson commented 3 years ago

Hello again Andris! 😁

You already have our gatsby-config.js file right?

So the output looks correct,

info Checking Craft config version.
info Craft config version has not changed since last sourcing. Checking for content changes since "2021-10-20 07:58:48".
info Sourcing changes for 4 nodes.
success Checking for changed pages - 0.001s
success source and transform nodes - 1.444s
success building schema - 6.310s
success createPages - 0.185s
info Total nodes: 1305, SitePage nodes: 101 (use --verbose for breakdown)
success Checking for changed pages - 0.006s
success update schema - 1.771s
success onPreExtractQueries - 0.000s
success extract queries from components - 1.890s
success write out requires - 0.002s
success Writing page-data.json files to public directory - 0.019s - 0/96 4944.91/s

But no changes are reflected on the site until we run "gatsby clean" first. Then the changes are there on the next run of "gatsby develop". Our site as you know is a multisite but now we only have the default site active, this behavior is the same either way. Seems like incremental changes are not picked up. https://github.com/craftcms/gatsby-helper/issues/16 seems to have similar issues.

Also on Netlify we need to do a "Clear cache and rebuild" for changes to be picked up.

Just let me know if you need anything else from us.

// Andreas

andris-sevcenko commented 3 years ago

Have you modified the sitesEnabled plugin setting?

andreasottosson commented 3 years ago

No, we don't have that in there at all.

andris-sevcenko commented 3 years ago

Alright, just cut the 1.0.7 Gatsby Helper release that should fix this!

andreasottosson commented 3 years ago

Nice work, as always! Thanks.