Hello,
I pre fetch CPT before server side rendereding, but for some reasons it is very inconsistent (sometimes some CPT do not get added to the state at all)
This is the code im using in src / index.js
actions: {
theme: {
beforeSSR: ({ state, actions }) => {
actions.source.fetch('/article',{ force: true });
actions.source.fetch('/expertise',{ force: true });
actions.source.fetch('/casestudy',{ force: true });
},
Usually happens when the first loaded page is not the home page
Works just fine when first page to be loaded is home page
What could cause that?
Any chance someone knows what is wrong and/or a better way to do it?