Setting Homepage in @frontity/wp-source Error

Hey!

I’m trying to set the Frontity homepage on my project.

Wordpress site: benwrightdev.com
Frontity site: https://ben-frontity-5fr73vuky.now.sh/homepage/

Here’s my wp-source settings:

    {
  name: "@frontity/wp-source",
  state: {
    source: {
      api: "https://benwrightdev.com/wp-json",
      homepage: "/homepage",
    },
  },
},

I’m getting this error:

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)

When I remove the homepage setting, I run into no errors.

This is probably related to #366 but the /homepage shouldn’t be 404ing?

Any help greatly appreciated!
Thanks!

1 Like

Hi @ben.wright.dev

Welcome to the forums.

I have confirmed that the error occurs with "/homepage" as the homepage value. When I replace it with "/" the error goes away but I’m not getting anything on the page. This appears to be because your homepage has no content:

Let me know if this solves the problem for you. Failing that we can investigate further, but please provide a link to a repository that we can check. Thanks.

Hey @mburridge,

Thanks for the reply!

I’ve actually got it working now with ‘/homepage/’. I stripped down my theme and refactored code and the bug has gone! Looks like my error, apologies.

2 Likes

Hi @ben.wright.dev

Great to hear that you’ve got it sorted :raised_hands: ! We’re here to help if anything else crops up. We look forward to seeing what you’re building with Frontity. Let us know.

Hey @ben.wright.dev I’m not sure if this bug was affecting you in your case, but we merged a fix which should return a 404 instead of 500 with more specific information:

1 Like

That looks great! Thank you!

1 Like