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]: Cannot use dev on anything other than localhost #3112

Open
msmith-molecularyou opened this issue Mar 7, 2025 · 0 comments
Open

[Bug]: Cannot use dev on anything other than localhost #3112

msmith-molecularyou opened this issue Mar 7, 2025 · 0 comments
Labels
bug Something isn't working to-review Evidence team to review

Comments

@msmith-molecularyou
Copy link

msmith-molecularyou commented Mar 7, 2025

Describe the bug

With a recent Vite upgrade, it is no longer possible to reach the Vite dev server with any hostname other than 'localhost' unless that host is configured in vite.config.js.

As vite.config.js is not user configurable, this means Evidence cannot be used in dev mode at all outside of localhost, nor can development builds be tested on anything other than local machines.

Steps to Reproduce

Run evidence in dev mode, then try to reach the site with a custom hostname. This can be reproduced with the following CURL command:

curl -vvvv localhost:3000 -H "Host: example.com"

Logs

% curl -vvvv localhost:3000 -H "Host: example.com"
* Host localhost:3000 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:3000...
* Connected to localhost (::1) port 3000
> GET / HTTP/1.1
> Host: example.com
> User-Agent: curl/8.7.1
> Accept: */*
> 
* Request completely sent off
< HTTP/1.1 403 Forbidden
< Access-Control-Allow-Origin: *
< Content-Type: text/plain
< Date: Fri, 07 Mar 2025 00:15:49 GMT
< Connection: keep-alive
< Keep-Alive: timeout=5
< Transfer-Encoding: chunked
< 
Blocked request. This host ("example.com") is not allowed.
* Connection #0 to host localhost left intact
To allow this host, add "example.com" to `server.allowedHosts` in vite.config.js.% 

System Info

Severity

annoyance

Additional Information, or Workarounds

No response

@msmith-molecularyou msmith-molecularyou added bug Something isn't working to-review Evidence team to review labels Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working to-review Evidence team to review
Projects
None yet
Development

No branches or pull requests

1 participant