Skip to content

docs(starting-your-app): note Next.js dev origins for loopback targets - #758

Merged
okwasniewski merged 1 commit into
e2e-inc:mainfrom
SachinD6:docs/next-dev-origins
Oct 2, 2026
Merged

okwasniewski merged 1 commit into
e2e-inc:mainfrom
SachinD6:docs/next-dev-origins

Conversation

@SachinD6

@SachinD6 SachinD6 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

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. Next.js 16 dev target renders but never hydrates under 127.0.0.1 (allowedDevOrigins blocks /_next/*) #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

  • Changeset: not needed, docs only.
  • Docs updated in the same PR: docs/starting-your-app.mdx and skills/e2e/references/setup.md.
  • Not a breaking, contract, or engine contract change.

Review in cubic

## 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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@okwasniewski
okwasniewski merged commit e519886 into e2e-inc:main Oct 2, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants