Roots Sage 10: getting error: "Error occurred while trying to proxy: localhost:3000/"

756 views Asked by At

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?

1

There are 1 answers

1
Agent 327 On

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.