Access URLs

I have a fresh install of Trellis v1.20.0, Bud v6.9.1, and Sage v10.5.1 and for the life of me I can’t get my .test aka proxy URL to resolve. The site only resolves when using localhost:3000. Sometimes it redirects to the proxy URL like when logging in and other situations like clearing the permalinks. Is this the expected behaviour?
These are in my .env file

WP_HOME='http://laidbackkeywest.test'
WP_SITEURL='http://laidbackkeywest.test/wp'

Here is my bud.config.js file


/**
 * Build configuration
 *
 * @see {@link https://roots.io/docs/sage/ sage documentation}
 * @see {@link https://bud.js.org/guides/configure/ bud.js configuration guide}
 *
 * @typedef {import('@roots/bud').Bud} Bud
 * @param {Bud} app
 */
export default async (app) => {
  /**
   * Application entrypoints
   * @see {@link https://bud.js.org/docs/bud.entry/}
   */
  app
    .entry({
      app: ['@scripts/app', '@styles/app'],
      editor: ['@scripts/editor', '@styles/editor'],
    })

    /**
     * Directory contents to be included in the compilation
     * @see {@link https://bud.js.org/docs/bud.assets/}
     */
    .assets(['images'])

    /**
     * Matched files trigger a page reload when modified
     * @see {@link https://bud.js.org/docs/bud.watch/}
     */
    .watch(['resources/views', 'app'])

    /**
     * Proxy origin (`WP_HOME`)
     * @see {@link https://bud.js.org/docs/bud.proxy/}
     */
    .proxy('http://laidbackkeywest.test')

    /**
     * Development origin
     * @see {@link https://bud.js.org/docs/bud.serve/}
     */
    .serve('http://localhost:3000')

    /**
     * URI of the `public` directory
     * @see {@link https://bud.js.org/docs/bud.setPublicPath/}
     */
    .setPublicPath('/app/themes/sage/public/')

    /**
     * Generate WordPress `theme.json`
     *
     * @note This overwrites `theme.json` on every build.
     *
     * @see {@link https://bud.js.org/extensions/sage/theme.json/}
     * @see {@link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/}
     */
    .wpjson.settings({
      color: {
        custom: false,
        customDuotone: false,
        customGradient: false,
        defaultDuotone: false,
        defaultGradients: false,
        defaultPalette: false,
        duotone: [],
      },
      custom: {
        spacing: {},
        typography: {
          'font-size': {},
          'line-height': {},
        },
      },
      spacing: {
        padding: true,
        units: ['px', '%', 'em', 'rem', 'vw', 'vh'],
      },
      typography: {
        customFontSize: false,
      },
    })
    .useTailwindColors()
    .useTailwindFontFamily()
    .useTailwindFontSize()
    .enable();
};

Any help would be appreciated. Maybe this is the expected behaviour however in past versions of sage this was not the case so I am simply lost.

Hi @toddsantoro,

When you mention you can’t get http://laidbackkeywest.test to resolve, are you referring to a DNS resolution failure? What happens when you dig laidbackkeywest.test?

This is sounding more like a Trellis or system issue than Sage to me.

I am simply trying to type http://laidbackkeywest.test into a browser and get the site to come up with my development changes. I run vagrant up and the server starts up just fine and then I run yarn dev in my theme’s folder and it compiles just fine. and says this:

◉  sage ./public [d8067f812cf06b8bcf9f]
│
├─ entrypoints
│ ├─ app
│ │ ├─ js/runtime.js    46.81 kB
│ │ └─ js/app.js        41.46 kB
│ └─ editor
│   ├─ js/runtime.js    46.81 kB
│   └─ js/editor.js     26.77 kB
│
│
└─ compiled 44 modules in 227ms

ℹ server
╷
├─ proxy: http://laidbackkeywest.test (​http://laidbackkeywest.test​)
│
├─ dev: http://localhost:3000 (​http://localhost:3000​)
│
└─ ipv4: http://10.217.180.175:3000 (​http://10.217.180.175:3000​)

… watching project sources (and 25 other files)

Thanks for the detail - that looks normal, and is exactly what we’d expect to see from Sage. I suspect the issue is with either Trellis or your system.

The next step is understanding where your .test domain resolves to.

If you could share the output of dig laidbackkeywest.test or nslookup laidbackkeywest.test (Windows) that would be great.

; <<>> DiG 9.10.6 <<>> laidbackkeywest.test

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26261

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:

; EDNS: version: 0, flags:; udp: 4096

;; QUESTION SECTION:

;laidbackkeywest.test. IN A

;; ANSWER SECTION:

laidbackkeywest.test. 60 IN A 23.202.231.169

;; Query time: 36 msec

;; SERVER: 2600:1700:4c89:88:3223:3ff:fe21:e4a#53(2600:1700:4c89:88:3223:3ff:fe21:e4a)

;; WHEN: Mon Feb 27 12:07:08 EST 2023

;; MSG SIZE rcvd: 65

Its weird because this IP address is not on my network.

Great, thanks.

23.202.231.169 is a public address - this is the reason why you can’t access your project. Have you modified your hosts file at all?

The dig command should resolve to your Vagrant instance IP, which looks like it is in the 10.0.0.0/8 range based on your previous output.

1 Like

OMG… You nailed it. I had 3 entries for this domain in the hosts file. This is an old project and I have been tasked with re-building the site with the latest and greatest. Thank you so much!

Not to others - CHECK YOU HOSTS FILE TO BE SURE YOU ONLY HAVE ONE ENTRTY. EVEN THEN IT MIGHT BE WORTH IT TO STOP THE SERVER AND DELETE THE ENTRY IN THE HOSTS FILE AND RUN VAGRANT UP AGAIN.

1 Like

Great, glad you fixed it.

Vagrant / Trellis will usually manage the hosts file entries, unless it’s already in a bit of a mess.

1 Like