Hi,
I just saw the JS for WP Conf Talk from @SantosGuillamot and was very excited about the possibility to load Gutenberg template-parts into Frontity.
So I tried to do the sameā¦ But it wonāt work for me. I installed WordPress 5.5-beta1-48411, Gutenberg 8.5.1 and enabled Full Site Editing. I also created a template-part, which can be found at this wp-json url:
https://gatsby-wp.noesteprojecten.nl/wp-json/wp/v2/template-parts/
Currently, my beforeSSR looks like this:
beforeSSR: async ({ state, actions }) => {
// getNameAndDescription,
await Promise.all(
[
actions.source.fetch("acf/options"),
actions.source.fetch("acf/identity"),
actions.source.fetch("getWPConfig"),
actions.source.fetch("/contact"),
state.theme.templates.map((slug) =>
actions.source.fetch(`wp_template_part/${slug}`)
),
]
);
},
But I get the following error in my Terminal:
TypeError: Cannot read property 'map' of undefined
at beforeSSR (webpack-internal:///./packages/mars-theme/src/index.js:21:184)
at eval (webpack-internal:///./node_modules/@frontity/connect/src/create-store.js:5:1528)
at eval (webpack-internal:///./node_modules/@frontity/core/src/server/index.tsx:49:88)
at Array.map (<anonymous>)
at eval (webpack-internal:///./node_modules/@frontity/core/src/server/index.tsx:49:48)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at eval (webpack-internal:///./node_modules/koa-mount/index.js:16:290)
Am I missing something? Do I need a specific version of Frontity? Iām running version 1.9.0 at the moment.