3

Has anyone been able to make Roots Sage 10 work on Windows?

The following builds on this thread on Sage forum.

I'm using Local WP with my website accessible through http://my-site.local/. WSL terminal. I'm getting this error when visiting http://localhost:3000:

Error occurred while trying to proxy: localhost:3000/

Bud.config.js:

app
    .setUrl('http://localhost:3000')
    .setProxyUrl('http://my-site.local/')
    .watch(['resources/views', 'app']);

Package.json:

{
  ...
  "browserslist": [
    "extends @roots/browserslist-config"
  ],
  "engines": {
    "node": ">=16.0.0"
  },
  "type": "module",
  "scripts": {
    "dev": "bud dev",
    "build": "bud build",
    ...
  },
  "devDependencies": {
    "@roots/bud": "6.12.2",
    "@roots/bud-tailwindcss": "6.12.2",
    "@roots/sage": "6.12.2"
  }
}

Why is it not working?

drake035
  • 3,955
  • 41
  • 119
  • 229
  • Can we be confident that Sage is the issue? The error sounds like the connection isn't even making it to your Wordpress installation; in other words, something with Local WP? – brads3290 Jun 26 '23 at 01:45
  • I have never used this product before but using/building similar software leads me to believe you need to edit your windows hosts file. You need to add `my-site.local` in your hosts file and point it to `127.0.0.1` then your app will receive the request and be able to handle it, otherwise your computer actually tries to route to the internet. – Blizzardengle Jun 26 '23 at 16:34

1 Answers1

1

1. Configure Bud

Open the bud.config.js file and update the setUrl() and setProxyUrl() methods to point to your local development environment. For example, if your website is accessible through http://my-site.local/, you would update the setProxyUrl() method to .setProxyUrl('http://my-site.local/').

2. Start Bud

yarn dev

This will start Bud and open a development server at http://localhost:3000. You should now be able to access your Sage 10 site at http://localhost:3000.

Agent 327
  • 76
  • 8