The team is now working on the WordPress Interactivity API. This unblocks the same UX Frontity framework enabled but directly in WordPress Core, fully compatible with the new Site Editor.
Iāve set up a new Frontity site and changed state.source.api in frontity.settings.js to point to my WordPress site.
When I load the Frontity site (currently at localhost:3000) I get the following error displayed:
Internal Server Error
When I change it back to the default demo source (https://test.frontity.io/wp-json) everything works fine again.
Compilation succeeds but I also get this error in the terminal when attempting to load the page in the browser:
FetchError: invalid json response body at http://wptest.test/wp-json/wp/v2/posts/?_embed=true&page=1 reason: Unexpected token < in JSON at position 0
zyriab2
OK, figured it out.
I had permalinks set to āPlainā in WordPress. When I changed permalinks to any other setting, e.g. āPost nameā then my Frontity site displayed fine.
1 Like
luisherranz3
Youāre right @zyriab, right now wp-source only works with pretty permalinks. Totally our fault, that should be stated in our docs.
Iām going to add it to the docs todo list
luisherranz4
@community-team I am going to rename this topic from āInternal server errorā to āFrontity not working with plain permalinksā.
I think renaming topics is a good practice. It will help Google to index this page and people to find it.
Feel free to edit this or any other topic
zyriab5
Iāve received this additional info from @luisherranz:
wp-source doesnāt have handlers for query URLs like ?p=id or ?tag=slug
So wp-source needs permalinks right now but that can be solved in the future if users ask for it, although as far as I know nobody has requested that so far.
1 Like
alee.rezaee6
Hi
I got the same error but after changing the permalink it does not work again.
Plz help.
Thanks
mburridge8
Hi @alee.rezaee
Check that the permalinks in WordPress are set to one of the āpretty permalinkā settings, not to Plain.
If youāre still getting the error can you copy and paste it here, or post a screen grab of the error.
alee.rezaee9
Hi @mburridge
Here you are:
FetchError: invalid json response body at http://tarjomaanwp/wp-json/wp/v2/posts?_embed=true&page=1 reason: Unexpected token < in JSON at position 0
at eval (webpack-internal:///./node_modules/node-fetch/lib/index.mjs:276:32)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at populate (webpack-internal:///./node_modules/@frontity/wp-source/src/libraries/populate.ts:9:12)
at Object.eval (webpack-internal:///./node_modules/@frontity/wp-source/src/libraries/handlers/postTypeArchive.ts:8:13)
at eval (webpack-internal:///./node_modules/@frontity/wp-source/src/actions.ts:18:101)
Pablo10
Hi @alee.rezaee can you double check your frontity.settings file?
Unfortunately as this is happening in your local environment, we canāt reproduce the error to help you. In any case if you set-up an online environment we will be happy to help
alee.rezaee14
Hi
I found the issue. It was because of the installed plugins. The plugin is MB Rest API.
the error was:
( ! ) Fatal error: Uncaught Error: Call to undefined function rwmb_get_registry() in C:\wamp64-new\www\tarjomaanwprepo\wp-content\plugins\mb-rest-api\class-mb-rest-api.php on line 94
( ! ) Error: Call to undefined function rwmb_get_registry() in C:\wamp64-new\www\tarjomaanwprepo\wp-content\plugins\mb-rest-api\class-mb-rest-api.php on line 94