You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Next.js 16 dev target renders but never hydrates under 127.0.0.1 (allowedDevOrigins blocks /_next/*) #751
every page renders (SSR HTML + accessible tree are all there), but no client JavaScript ever loads — the page never hydrates. Locators resolve, clicks land (:focus moves), and React handlers never fire. Symptoms look like a timing flake; retries don't help because hydration never happens at all.
Root cause
Next.js 16 blocks cross-origin requests to dev resources by default. next dev binds/identifies as localhost, and the run opens http://127.0.0.1:<port> — requests to /_next/* (client chunks, HMR) get rejected:
Blocked cross-origin request to Next.js dev resource /_next/hmr from "127.0.0.1".
To allow this host in development, add it to "allowedDevOrigins" in next.config.js
The trap
app.url with port 0 only accepts a loopback IP (127.0.0.1/[::1]) — localhost is rejected with INVALID_APP_URL — so the only fix is app-side:
Either document this in the web target docs (it will hit every Next.js ≥16 user running a dev target), or warn at runtime when the served app logs the Next cross-origin block. A sentence in the docs would have saved real debugging time.
Workaround confirmed working: adding allowedDevOrigins: ['127.0.0.1'] to next.config restores hydration and the suite passes.
Fixed in #758. docs/starting-your-app.mdx now has a "Next.js dev targets" section with the allowedDevOrigins change, and skills/e2e/references/setup.md carries the same note. This issue can be closed.
Activity
docs(starting-your-app): note Next.js dev origins for loopback targets (
SachinD6 commentedon Oct 2, 2026
Fixed in #758.
docs/starting-your-app.mdxnow has a "Next.js dev targets" section with theallowedDevOriginschange, andskills/e2e/references/setup.mdcarries the same note. This issue can be closed.