TanStackT
TanStack12mo ago
12 replies
dramatic-maroon

Configuring server.allowedHosts for tunneling

I am building an API route to handle webhook events.
For local development, I need to configure a tunnel solution (e.g., ngrok, tunnelmole) to receive the events.
In recent versions, I encounter this error:
Blocked request. This host ("[subdomain].tunnelmole.net") is not allowed.  
To allow this host, add "[subdomain].tunnelmole.net" to `server.allowedHosts` in vite.config.js.  

However, the server option is not available in the Vite configuration, so there is no way to pass the allowedHosts configuration.

How can I resolve this issue? Is there any workaround ?
Was this page helpful?