roots / bud

High-performance build system that supports SWC, esbuild, and Babel
https://bud.js.org/
MIT License
320 stars 38 forks source link

[bug] Can't change URL of dev server #2546

Closed cawa-93 closed 5 months ago

cawa-93 commented 5 months ago

Agreement

Describe the issue

In config I call

    app
        .setUrl(new URL(`http://example.test`))
        .watch(['web/app/themes/your-theme-name/resources/views', 'app']);

Expected Behavior

Dev server starts normally. When you visit the page, the bud tries to request http://example.test/bud/hot to get updates

Actual Behavior

Bud show error:

$ bud dev
2024-01-12T16:40:40.146758137Z 
2024-01-12T16:40:40.146779248Z BudError
2024-01-12T16:40:40.146785169Z 
2024-01-12T16:40:40.146792042Z ✘ options.port should be >= 0 and < 65536. Received type number (NaN).
2024-01-12T16:40:40.146800588Z 
2024-01-12T16:40:40.146806940Z ℹ Stack trace
2024-01-12T16:40:40.146813342Z 
2024-01-12T16:40:40.146819714Z │  at BuildDevelopmentCommand.catch
2024-01-12T16:40:40.146824694Z │ (./node_modules/@roots/bud/lib/cli/commands/index.js:186:30)
2024-01-12T16:40:40.146829603Z │  at ./node_modules/clipanion/lib/advanced/Cli.js:229:102
2024-01-12T16:40:40.146834512Z │  at async Cli.run (./node_modules/clipanion/lib/advanced/Cli.js:229:24)
2024-01-12T16:40:40.146839692Z │  at async Cli.runExit (./node_modules/clipanion/lib/advanced/Cli.js:238:28)
2024-01-12T16:40:40.146844391Z │  at async ./node_modules/@roots/bud/lib/cli..js:133:1
2024-01-12T16:40:40.146850092Z 
2024-01-12T16:40:41.893795702Z 
2024-01-12T16:40:41.893841910Z ╭ sage [868ac996ccbad407]                ./web/app/themes/your-theme-name/public
2024-01-12T16:40:41.893851007Z │
2024-01-12T16:40:41.893857640Z │ app
2024-01-12T16:40:41.893863902Z │  ◯ js/runtime.js                                                    ✔ 12.53 kB
2024-01-12T16:40:41.893870825Z │  ◯ js/app.js                                                        ✔ 164.1 kB
2024-01-12T16:40:41.893877307Z │
2024-01-12T16:40:41.893883279Z ╰ 1s 729ms 101 modules [0/101 modules cached]
2024-01-12T16:40:41.893889490Z 
2024-01-12T16:40:41.893895462Z  Network
2024-01-12T16:40:41.893901653Z 
2024-01-12T16:40:41.893907675Z  › Dev    ┄ http://example.test/
2024-01-12T16:40:41.893914037Z           ┄ http://172.20.0.3/
2024-01-12T16:40:41.931130134Z mv: cannot stat 'theme.json': No such file or directory

When you visit the page, the bud tries to request http://<current domain>/bud/hot to get updates

Steps To Reproduce

Project here - https://github.com/cawa-93/lando-wp/tree/wp-bedrock-sage Run lando start

version

6.20.0

Logs

No response

Configuration

No response

Relevant .budfiles

No response

retlehs commented 5 months ago

Please use https://discourse.roots.io/ for support requests

cawa-93 commented 5 months ago

@retlehs It's not support request 😆 It's literally error on docs example: https://github.com/roots/bud/blob/40bdad7398d66630da7aaf3b825564f22d10cd63/sources/%40roots/bud-api/docs/setUrl/usage.md?plain=1#L17

retlehs commented 5 months ago

Getting support with how to configure Bud correctly with Bedrock, Sage, and Lando shouldn't be done on this issue tracker

Our Discourse has at least a couple of examples from folks who have already shared how to do this, for example https://github.com/rkaalma/roots-lando-bedrock-sage-bud-example