Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Dev session on network IP loads assets from 0.0.0.0 #1765

Closed
retlehs opened this issue Oct 11, 2022 · 3 comments
Closed

[bug] Dev session on network IP loads assets from 0.0.0.0 #1765

retlehs opened this issue Oct 11, 2022 · 3 comments
Assignees
Labels
bug Something isn't working stale
Milestone

Comments

@retlehs
Copy link
Member

retlehs commented Oct 11, 2022

Describe the issue

bud dev shows a nifty external IP address that can be used to visit the dev session from another device on your network. When visiting the external IP, bud serves assets from 0.0.0.0 instead of 192.168.x.x, which results in missing styles

Expected Behavior

The bud dev session shouldn't have any missing assets

Actual Behavior

The bud dev session tries to load assets from 0.0.0.0, which is unreachable unless you're on the same machine as the bud dev session

Steps To Reproduce

  1. yarn dev
  2. Visit the provided external address

version

6.4.5

@retlehs retlehs added the bug Something isn't working label Oct 11, 2022
@retlehs
Copy link
Member Author

retlehs commented Oct 11, 2022

A workaround that can be added to the Bud config for now:

...

    app.proxy(`http://example.test`, searches => [
      ...searches,
      [`0.0.0.0:3000`, `192.168.xxx.xxx:3000`] // Replace with correct address
    ])

@kellymears
Copy link
Contributor

want to make sure that our solution doesn't blow up existing docker configs that might be using a similar callback in bud.proxy.

kodiakhq bot pushed a commit that referenced this issue Oct 15, 2022
- adds `@roots/bud-support/os` with `externalNetworkInterface` utility
- `externalNetworkInterface.ipv4` will return the first non-internal IPv4 address it finds (or `0.0.0.0` as a fallback -- although I'm not sure if this is even possible)
- uses the value of `externalNetworkInterface.ipv4` as the `origin` of the default dev server URL

## todo

- [ ] does this mess anything up with docker and other similar user configs?
- [ ] update docs
- [ ] sage default config will need updating. 

## sage

this will override the default set in this PR and enforce 0.0.0.0:

https://github.com/roots/sage/blob/20f92ebe642fe1b97a35f52bf27b220676f7f6df/bud.config.mjs#L37 

better to set the port only:

```typescript
bud.serve(3000)
```

refers:

- #1765

## Type of change

**PATCH: backwards compatible change**



This PR includes breaking changes to the following core packages:

- none

This PR includes breaking changes to the follow extensions:

- none

## Dependencies

### Adds

- none

### Removes

- none
@kellymears kellymears self-assigned this Oct 27, 2022
@kellymears kellymears added this to the 6.5.4 milestone Oct 27, 2022
@kellymears kellymears modified the milestones: 6.5.4, 6.7.0 Nov 15, 2022
@github-actions
Copy link

Message to comment on stale issues. If none provided, will not mark issues stale

@github-actions github-actions bot added the stale label Jan 30, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants