ServerError: post type from endpoints "posts, pages, media" with slug "home-post" not found

Iā€™ve been testing Frontity with a local instance of Wordpress and have been able to grab data from posts, pages, etc so far. I have a Wordpress instance set up publicly (not ssl/https) and am testing grabbing data from the public test Wordpress instance. Upon doing this and attempting to actions.source.fetch(ā€˜home-postā€™) I constantly receive an error in my console that is presented as the name of this post: ā€œServerError: post type from endpoints ā€œposts, pages, mediaā€ with slug ā€œhome-postā€ not foundā€.

My frontity.settings source url is ā€œhttp://test.pritchardelectric.net.user.server296.com/ā€. Iā€™m not using the wp-json appended considering I didnā€™t need to do this to receive data from my localhost wordpress instance. And I receive an error with that appended any ways (different error).

Iā€™m viewing the network response, and am receiving an empty array from ā€œhttp://test.pritchardelectric.net.user.server296.com/wp-json/wp/v2/posts?_embed=true&slug=home-postā€

When I go to this url directly in browser I can see the expected json associated, which is weird Iā€™m not receiving data back in the network response from the actions.source.fetch.

Not sure why this is working on local and not public. I have the same post name/permalink on public, and same permalink types set globally. Iā€™m calling actions.source.fetch in a use effect within my Home.js component.

The repo is private. So please let me know if you have any questions. Thank you so much in advance.

WP Rest API URL is the site with /wp-json appended

Hi @vensoneandrew

Welcome to the Frontity community.

We regret that we cannot provide support if your repo is private. Frontity is open source software and we would like the answers we provide in this forum to be of benefit to all developers working with Frontity.

If you can reproduce your problem in a project that is in a public repo then we will be happy to try to help.

1 Like

Hi! Thank you for the reply. The repo is now public. The fetch is being made in the home component.

Please let me know if you may have any questions

Hi @vensoneandrew

Thanks for making your repo public. Iā€™ve cloned your repo but unfortunately I canā€™t reproduce your error. As you can see from the screenshots below Iā€™m getting the data for home-post in the state and Iā€™m not receiving the error that youā€™re getting in the console.

As you can see the above corresponds with the data received from the URL you provided:

Hm very interesting. I didnā€™t update the latest code that has the url of the site in frontity.settting.js source url. Unfortunately our power is out here in Texas, and I didnā€™t push new commits beforehand. Iā€™m assuming you replaced the source url with the public wp site and were able to retrieve this data. You didnā€™t receive any errors in the console? Very strange.

I was able to navigate the json data before as well within the browser, but received an error in console that frontity wasnā€™t able to retrieve any posts from that slug. Whenever our power comes back on Iā€™ll check to see if it is working on my end. Thank you for looking into this!

Hi @vensoneandrew

Yup, I figured that http://localhost/pedev wasnā€™t going to cut it for me! :smile:

I did get errors, but they were for things like faq and gallery, i.e. items in the menu which are links to pages that donā€™t seem to exist in the json returned from the REST API so I didnā€™t worry about them. I didnā€™t get the error about home-post - clearly, because Iā€™m getting the data. :man_shrugging:

Good luck with resolving this, and hope the power comes back soon. Let me know if you need to run anything else past me.

Thank you for looking into this. Power came back on, and tested site. It is indeed working. Not sure why I got those errors at first. Maybe it took a while for the new post to be reflected in wordpress or something ā€¦ not entirely sure. Thank you!

1 Like