I’m attempting to build a new site in Wordpress with Frontity; however, I’m running into an issue.
I’m using @frontity/mars-theme
as my theme.
The site I am building has a plugin called “Cooked” which creates a custom postType of cp_recipe
with an endpoint of cooked_recipe
.
I have added this to my frontity.settings.js
for wp-source
:
{
"name": "@frontity/wp-source",
"state": {
"source": {
"api": "http://localhost/wp-json",
"params": {
"per_page": 5,
"type": ["post", "page", "cp_recipe"]
},
"homepage": "/home",
"postTypes": [
{
"type": "cp_recipe",
"endpoint": "cooked_recipe"
}
]
}
}
}
However, when I browse to one of these recipes using its slug (ie: http://localhost:3000/cp_recipe/pan-seared-bonafidebbq-chicken) I get an internal server error and the console outputs:
TypeError: Cannot read property 'split' of undefined
at __webpack_exports__.default (webpack-internal:///./node_modules/@frontity/wp-source/src/libraries/handlers/utils/capitalize.ts:2:73)
at Object.eval (webpack-internal:///./node_modules/@frontity/wp-source/src/libraries/handlers/postType.ts:10:205)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at eval (webpack-internal:///./node_modules/@frontity/wp-source/src/actions.ts:22:101)
Reading the forums, and several Github issues, I’ve seen many people mention this error but no clear way as to how to troubleshoot or resolve it.