Another ECONNREFUSED post - Local By Flywheel

Hello there, I’ve got an issue that I’ve seen a couple of other similar posts about here and elsewhere on the internet, but none of the solutions have worked for me.

I finished the general tutorial yesterday, so I set out to create a new project for a Wordpress site I’m building for a client. I’m currently using Local by Flywheel to work on the site locally (and the site is running on local without issue). I’ve created a new theme folder as per the tutorial instructions, and I’ve changed my settings file to this:

const settings = {

ā€œnameā€: ā€œandi-yoga-blogā€,

ā€œstateā€: {

"frontity": {

  "url": "http://yoga-with-andi.local",

  "title": "Yoga With Andi Blog",

  "description": "A Blog and Marketing Website For Andi Senatro Yoga"

}

},

ā€œpackagesā€: [

{

  "name": "yoga-blog",

},

{

  "name": "@frontity/wp-source",

  "state": {

    "source": {

      "url": "http://yoga-with-andi.local"

    }

  }

},

"@frontity/tiny-router",

"@frontity/html2react"

]

};

export default settings;

Unfortunately, when trying to run the dev environment I’m greeted with the following error:

FetchError: request to http://yoga-with-andi.local/wp-json/wp/v2/posts?_embed=true&page=1 failed, reason: connect ECONNREFUSED 127.0.0.1:80

What am I missing here? I have gone through all of the other questions I’ve seen, and I’ve made sure that permalinks are set correctly in WP. I haven’t customized any other aspects of the project yet other than creating the new theme file. According to this link (which is the only good example of frontity with local by flywheel) they are able to just enter the url and it works (even though they use the deprecated api variation) Creating a Headless WordPress Site With Frontity | CSS-Tricks

If I revert it back to the default https://test.frontity.org I get the expected:

You can edit your package in:

packages/yoga-blog/src/index.js

Any help would be appreciated. I’m excited to have a simple way to implement a headless WP setup, but I’ve been trying to figure out this error for over an hour, so it’s not turning out to be as simple as I’d like.

Based on the settings you posted you have both WP and Frontity running at http://yoga-with-andi.local, meaning they’re both in the same Local box (and therefore looking for 127.0.0.1).

The tutorial you posted assumes you have 2 different boxes at different URL’s, so this might be the issue.

Also, wp-source is currently looking at port 80, while by default Frontity is running at port 3000.
So you can try to change the url to include port 3000 and see if that works.