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

fix: ensure server.host is passed in preview-mode (fix #5387) #5389

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

JoviDeCroock
Copy link
Contributor

Description

options.host wasn't being passed to server even though it was listed as a CLI-option, this passes through the option so host is properly respected

Fixes #5387

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JoviDeCroock! The --host option is being passed to preview already in the second parameter and correctly used to start sirv AFAICS. But the printHttpServerUrls(server, config) was not correctly getting this information. This is a regression after #5016.

I think using the inline config here directly as this PR does is better though. We could remove the second parameter to preview (the API is experimental and there aren't any users, SvelteKit decided not to use it after it was exposed). The change in this PR only affects logging, but we could merge it as a temporary fix.

Let's merge this one and I'll issue another PR with the breaking change to preview to discuss and see if we can add it to the 2.7 beta.

@patak-dev patak-dev merged commit 61b4b39 into vitejs:main Oct 22, 2021
@JoviDeCroock JoviDeCroock deleted the ensure-host-preview branch October 22, 2021 20:59
@patak-dev patak-dev mentioned this pull request Oct 24, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vite preview --host doesn't log the host address
2 participants