Repository navigation
docs(starting-your-app): note Next.js dev origins for loopback targets - #758
Merged
Merged
Conversation
## What and why - A Next.js 16 dev target under the loopback address the runner recommends never hydrates, and nothing in the docs says why. e2e-inc#751 reports it and asks for a docs sentence or a runtime warning. - The dev server blocks cross-origin requests to its dev resources. The browser origin is `127.0.0.1`, `next dev` identifies as `localhost`, and hydration never starts, so locators resolve and clicks land with no React handler behind them. - `docs/starting-your-app.mdx`: a `### Next.js dev targets` section beside the free-port recipe. It covers `127.0.0.1` and `[::1]`, names the `localhost` case that needs no entry, and shows the `next.config.ts` change. - `skills/e2e/references/setup.md`: the same fact in one paragraph under the app table. - Docs only. The runner and the web engine are unchanged. ## Verified Ran it locally: yes - Scratch project at `/tmp` with `e2e` 0.15.1, `@e2e-dev/web` 0.11.1, Next.js 16.3.8, `app.url: 'http://127.0.0.1:0'`, `next dev app -p {port}`: | Check | No entry | `allowedDevOrigins: ['127.0.0.1']` | | --- | --- | --- | | React attached to the button | 0 keys at 9s | 2 keys at 3s | | Click result | stays `0` | becomes `1` | | Dev server log | `Blocked cross-origin request to Next.js dev resource /_next/hmr from "127.0.0.1".` | no blocked lines | | `e2e run` | 1 failed | 1 passed | - `http://[::1]:4321/` hydrates with `allowedDevOrigins: ['[::1]']`, and `http://localhost:4321/` hydrates with no entry at all. - `pnpm check`: pass, including `mint validate` and `mint broken-links`. - `pnpm --filter @e2e-dev/testbed test`: 70 passed, 1 skipped. - Rendered in `pnpm docs:dev`: the section and the config block appear on `/starting-your-app`. ## Checklist - [x] Changeset: not needed, docs only. - [x] Docs updated in the same PR: `docs/starting-your-app.mdx` and `skills/e2e/references/setup.md`. - [x] Not a breaking, contract, or engine contract change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
127.0.0.1,next devidentifies aslocalhost, and hydration never starts, so locators resolve and clicks land with no React handler behind them.docs/starting-your-app.mdx: a### Next.js dev targetssection beside the free-port recipe. It covers127.0.0.1and[::1], names thelocalhostcase that needs no entry, and shows thenext.config.tschange.skills/e2e/references/setup.md: the same fact in one paragraph under the app table.Verified
Ran it locally: yes
/tmpwithe2e0.15.1,@e2e-dev/web0.11.1, Next.js 16.3.8,app.url: 'http://127.0.0.1:0',next dev app -p {port}:allowedDevOrigins: ['127.0.0.1']01Blocked cross-origin request to Next.js dev resource /_next/hmr from "127.0.0.1".e2e runhttp://[::1]:4321/hydrates withallowedDevOrigins: ['[::1]'], andhttp://localhost:4321/hydrates with no entry at all.pnpm check: pass, includingmint validateandmint broken-links.pnpm --filter @e2e-dev/testbed test: 70 passed, 1 skipped.pnpm docs:dev: the section and the config block appear on/starting-your-app.Checklist
docs/starting-your-app.mdxandskills/e2e/references/setup.md.