Frontity looks like a really compelling solution; thank you so much. I am keen to give it a go.
I am trying to add lists and post endpoints for a new custom post type, and I found this handler for a product post type in the documentation: https://docs.frontity.org/api-reference-1/wordpress-source#example-1
I placed this code block in
mars-theme/src/index.js within the mars-theme’s
before constant, so it is called in the
beforeSSR action. Unfortunately, when loading the new
products endpoint, I see a 404 error in the browser and in the terminal this error:
TypeError: Cannot destructure property
idof ‘undefined’ or ‘null’.
at attachmentHandler (webpack-internal:///./node_modules/@frontity/wp-source/src/libraries/handlers/attachment.ts:4:129)
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at Object.postType [as func] (webpack-internal:///./node_modules/@frontity/wp-source/src/libraries/handlers/postType.ts:5:262)
at eval (webpack-internal:///./node_modules/@frontity/wp-source/src/actions.ts:13:100)
I have been able to get a small Create React App to list these CPTs no problem, so I know the REST API is open, and can see the JSON, but would love to better understand how Frontity works to get this working. Any help or tips hugely appreciated.