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

--host is missing after restart #5799

Closed
1 task done
chenxsan opened this issue Jan 8, 2023 · 2 comments · Fixed by #5840
Closed
1 task done

--host is missing after restart #5799

chenxsan opened this issue Jan 8, 2023 · 2 comments · Fixed by #5840
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@chenxsan
Copy link
Contributor

chenxsan commented Jan 8, 2023

What version of astro are you using?

1.9.1

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

Mac

Describe the Bug

So I was running npm run dev -- --host to start the devServer:

> astro dev --host

06:34:02 PM [content] Types generated
06:34:03 PM [content] Watching src/content/ for changes
  🚀  astro  v1.9.1 started in 839ms
  
  ┃ Local    http://localhost:3001/
  ┃ Network  http://192.168.2.66:3001/
             http://10.147.19.74:3001/
             http://169.254.164.104:3001/

And I was able to access url like http://192.168.2.66:3001/.

Then I made a change to my tailwind.config.cjs file, saved the file and I can saw the terminal updated with logs:

06:35:17 PM [astro] update /tailwind.config.cjs
06:35:17 PM [astro] Configuration updated. Restarting...

06:35:17 PM [content] Types generated
06:35:18 PM [content] Watching src/content/ for changes
06:35:18 PM [astro] update /src/content/types.generated.d.ts

Now I can no longer access http://192.168.2.66:3001/ while I was still able to open http://localhost:3001/.

I can see config.server.host set to true in the beginning,

But It was reset to false after restart:

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-nvmtqq?file=tailwind.config.cjs&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.
@natemoo-re
Copy link
Member

Thanks for opening an issue! Definitely seems like a bug in our restart logic, but it does look like we're passing CLI arguments through correctly.

https://github.com/withastro/astro/blob/main/packages/astro/src/core/dev/restart.ts#L153

I wonder if this is just an issue with how we're displaying the message? Happy to review a PR if you want to look into this more!

@natemoo-re natemoo-re added the - P3: minor bug An edge case that only affects very specific usage (priority) label Jan 11, 2023
@chenxsan
Copy link
Contributor Author

I believe that flags comes from https://github.com/withastro/astro/blob/main/packages/astro/src/core/dev/dev.ts#L38 which is always an empty {}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants