Dev server doesn't work when update Bud

I was working with bud 6.4.5. When I try to upgrade to 6.5.3 or 6.6.3 I can’t access to dev URL from browser.

My initial server config (working with 6.4.5):

    /**
     * Proxy origin (`WP_HOME`)
     */
    .proxy('https://nomanisanisland.test')

    /**
     * Development origin
     */
    .serve({
      host: '0.0.0.0',
      cert: app.path('/Users/aitor/Library/Application Support/mkcert/0.0.0.0.pem'),
      key: app.path('/Users/aitor/Library/Application Support/mkcert/0.0.0.0-key.pem'),
    })

This config, at yarn dev, returns

​https://localhost:3000

instead

https://0.0.0.0:3000

ℹ server
╷
├─ proxying: https://nomanisanisland.test (​https://nomanisanisland.test​)
├─ internal: https://localhost:3000 (​https://localhost:3000​)
└─ external: https://192.168.1.128:3000 (​https://192.168.1.128:3000​)

… watching project sources (and 55 other files)

So even though it works, there must be something wrong with this configuration.

When upgrade to 6.5.3 yarn dev doesn’t return the proxy:

ℹ server
╷
├─ internal: https://localhost:3000 (​https://localhost:3000​)
├─ external: https://192.168.1.128:3000 (​https://192.168.1.128:3000​)

… watching project sources (and 55 other files)

Also I tried to add a node URL as docs said.

Captura de pantalla 2022-11-30 a las 9.07.50

host: new URL('0.0.0.0')

It throws an error of argument type in the IDE, and yarn dev doesnt work.

I don’t think there is anything wrong. 0.0.0.0 and localhost are functionally equivalent here (they both resolve to the same place unless you’re using a container of some kind). The url formatter just prefers localhost because there are less issues with it across different environments.

This is the formatter:

Would it be better if it said something like internal: https://localhost:3000 (0.0.0.0, ssl enabled)?

Thanks for pointing out the issue with the docs. I updated them to reflect the actual available options.


Just to be clear – your dev server is still working – the concern is just that the dashboard says https://localhost:3000 instead of https://0.0.0.0:3000?

If 0.0.0.0 is secure but localhost isn’t, I’d recommend generating the certificate with an actual hostname (this is a good idea, generally). At the very least, specify all the interfaces the site might be resolved from:

mkcert 0.0.0.0 localhost mysite.test ::1
2 Likes

Thank you for your help and explanations.

Just in case, I have generated a new certificate, but the old one was also valid for both domains localhost and 0.0.0.0.

$ mkcert nomanisanisland.test localhost 0.0.0.0 ::1 
Note: the local CA is not installed in the Firefox trust store.
Run "mkcert -install" for certificates to be trusted automatically ⚠️

Created a new certificate valid for the following names 📜
 - "nomanisanisland.test"
 - "localhost"
 - "0.0.0.0"
 - "::1"

The certificate is at "./nomanisanisland.test+3.pem" and the key at "./nomanisanisland.test+3-key.pem" ✅

Then I’ve updated the server setup:

    /**
     * Proxy origin (`WP_HOME`)
     */
    .proxy('https://nomanisanisland.test')

    /**
     * Development origin
     */
    .serve({
      url: new URL('https://0.0.0.0:3000'),
      cert: app.path('/Users/aitor/Library/Application Support/mkcert/nomanisanisland.test+3.pem'),
      key: app.path('/Users/aitor/Library/Application Support/mkcert/nomanisanisland.test+3-key.pem'),
    })

Then, yarn dev output:

ℹ server
╷
├─ internal: https://localhost:3000 (​https://localhost:3000​)
├─ external: https://192.168.1.128:3000 (​https://192.168.1.128:3000​)

… watching project sources (and 55 other files)

EDIT: Note that there is no proxy like this:

ℹ server
╷
├─ proxying: https://nomanisanisland.test (​https://nomanisanisland.test​)

I tried to replace

.proxy('https://nomanisanisland.test')

with

.proxy(new URL('https://nomanisanisland.test'))

Then, when I try to acces to https://localhost:3000 or https://0.0.0.0:3000 with browser, it keep waiting until timeout.

ERR_EMPTY_RESPONSE

It’s not a problem with certificates, because that kind of problem is reported in the browser and I can access with no problems to https://nomanisanisland.test. It has to be something else.

My setup is a little different than this, but I was having the same problem. Bud 6.6.5 seems to have resolved the issue.

2 Likes

Thanks for the notice!