TX028

Blocked host

Console

Text.js error TX028: Blocked request. This host (…) is not allowed. Add it to `…` in text.config.ts.

Why this happens

text dev, and text start while bound to loopback (the default), only answer requests addressed to localhost, a *.localhost name or an IP address. This protects them from DNS rebinding. A request arrived with another Host header, typically through a tunnel, a reverse proxy or a LAN hostname.

How to fix it

Allow the host in text.config.ts. text dev reads Vite's vite.server.allowedHosts, and text start reads server.allowedHosts. A leading . allows subdomains:

text.config.tsts
import { defineConfig } from "@textjs/app";export default defineConfig({  // text dev  vite: { server: { allowedHosts: ["my-laptop.local", ".ngrok.app"] } },  // text start  server: { allowedHosts: [".example.com"] },});

text start --host with any address other than loopback skips the check. See Behind a proxy.