# Yarn dev return error

**URL:** https://discourse.roots.io/t/yarn-dev-return-error/23461
**Category:** sage
**Tags:** bud, sage10
**Created:** 2022-06-29T17:25:04Z
**Posts:** 11

## Post 1 by @Hossein_khan — 2022-06-29T17:25:04Z

Hi guys  
I am new in sage. I ran yarn dev with below bud.config:

```
/**
 * @typedef {import('@roots/bud').Bud} bud
 *
 * @param {bud} app
 */
module.exports = async (app) => {
  app
    /**
     * Application entrypoints
     *
     * Paths are relative to your resources directory
     */
    .entry({
      app: ['@scripts/app', '@styles/app'],
      editor: ['@scripts/editor', '@styles/editor'],
    })

    /**
     * These files should be processed as part of the build
     * even if they are not explicitly imported in application assets.
     */
    .assets('images')

    /**
     * These files will trigger a full page reload
     * when modified.
     */
    .watch('resources/views/ **/*', 'app/** /*')

    /**
     * Target URL to be proxied by the dev server.
     *
     * This should be the URL you use to visit your local development server.
     */
    .proxy('http://localhost/sage')

    /**
     * Development URL to be used in the browser.
     */
    .serve('http://localhost:3000/sage')

    /**
     * Relative path to the public directory.
     */
    .setPublicPath('/app/themes/sage/public/');
};
```

 ![scr](https://discourse.roots.io/uploads/default/original/2X/3/3a35e75729b39f375868a06f26e7aca20edf91c5.png)

but I got “Error occurred while trying to proxy: localhost:3000/sage/” in localhost:3000/sage url and "[proxy] › :heavy_multiplication_x: [HPM] Error occurred while proxying request localhost:3000/sage/ to [http://localhost/sage](http://localhost/sage) " in terminal

I use wampserver

---

## Post 2 by @ben — 2022-06-29T18:28:53Z

Howdy!

> [@Hossein_khan](#):
>
> `.proxy('http://localhost/sage')`

> [@Hossein_khan](#):
>
> `.serve('http://localhost:3000/sage')`

I’d highly recommend refining your development environment so that you’re serving your site from an individual host, like `example.test`

---

## Post 3 by @Hossein_khan — 2022-06-30T00:21:46Z

Thanks a lot @ben  
I have create a VirtualHost named “sage.test” so I have:

.proxy(‘[http://sage.test](http://sage.test)’)  
.serve(‘[http://localhost:3000/sage](http://localhost:3000/sage)’)

but I got same error

---

## Post 4 by @aphagon — 2022-06-30T08:16:19Z

I have the same problem

 ![111](https://discourse.roots.io/uploads/default/original/2X/d/d12a24e954dbc13d43b5f80e2e5031fcb8aba79e.jpeg)

open browser error: Error occurred while trying to proxy: localhost:3000/  
 ![222](https://discourse.roots.io/uploads/default/original/2X/3/35f9832f7f63e2710984a1e340db49f95f9205d3.jpeg)

my code: bud.config.js

```
/**
 * @typedef {import('@roots/bud').Bud} bud
 *
 * @param {bud} app
 */
module.exports = async (app) => {
  app
    /**
     * Application entrypoints
     *
     * Paths are relative to your resources directory
     */
    .entry("app", ["@scripts/app", "@styles/app"])

    /**
     * These files should be processed as part of the build
     * even if they are not explicitly imported in application assets.
     */
    .assets([
      { from: app.path("@src/images"), to: app.path("@dist/images/@file") },
    ])

    /**
     * These files will trigger a full page reload
     * when modified.
     */
    .watch("tailwind.config.js", "resources/views/ **/*", "app/** /*")

    /**
     * Target URL to be proxied by the dev server.
     *
     * This should be the URL you use to visit your local development server.
     */
    .proxy("http://moomee.test")

    /**
     * Development URL to be used in the browser.
     */
    .serve("http://localhost:3000")

    /**
     * Relative path to the public directory.
     */
    .setPublicPath("/wp-content/themes/mootoon/public/");
};
```

I have been stuck with this problem for days, searched all threads, and couldn’t find a solution.

---

## Post 5 by @alwaysblank — 2022-06-30T13:38:29Z

> [@aphagon](#):
>
> `http://moomee.test`

Can you connect to [http://moomee.test/](http://moomee.test/) in your browser? Your error shows `ECONNREFUSED` which suggests it’s having trouble connecting. What environment are you running this command in?

---

## Post 6 by @aphagon — 2022-06-30T14:31:42Z

Yes, I can connect to [http://moomee.test/](http://moomee.test/) success.

 ![12323](https://discourse.roots.io/uploads/default/original/2X/7/7d0ca34e6c9ce1735283ed625e7caf3ad8e1aa5a.jpeg)

project run web server in Laragon and Linux WSL2 on Windows run bud.js

---

## Post 7 by @Hossein_khan — 2022-07-17T06:31:52Z

Hi, are there any solutions?

---

## Post 8 by @kellymears — 2022-07-17T08:28:23Z

I’m not sure what the issue is here, based on present info. I can say that users are successfully using bud with WSL2, and this is _likely_ not a problem with bud but most likely a dev server configuration issue.

I’d think the next step is to make sure that your server is issuing a normal response (code 200). Others have reported similar issues and it has been the result of the server issuing a redirection or failure status. bud is not set up to follow proxy redirections, by default.

Under the network panel in devtools, what are the response headers being issued by the server? That’s the next thing I would check.

---

## Post 9 by @Suraj_Sanwal — 2023-12-02T07:19:45Z

Hey @Hossein_khan

I’m experiencing the same issue with local setup using laragon and WSL2 in windows  
Did you fix this problem?

---

## Post 10 by @ben — 2023-12-02T16:57:44Z

Please use [your existing topic](https://discourse.roots.io/t/error-occurred-while-trying-to-proxy-localhost-3000-in-windows/26347/6) instead of this one that is a year old

---

## Post 11 by @ben — 2023-12-02T16:57:47Z


