倉庫指標
- 星標
- (8,563 顆星)
- PR 合併指標
- (平均合併 1天 1小時) (30 天內合併 462 個 PR)
描述
This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext
mainvs Next.jsv16.2.6, 2026-05-20).
Problem
The next/form <Form> component does not perform client-side soft navigation. Form submissions fall through to the browser's default behavior (full MPA page navigation) instead of being intercepted for SPA-style transitions.
Tests verify that after a form submission, the page did NOT do a full MPA navigation (didMpaNavigate() should return false). In vinext, it returns true because the form submit causes a full page reload.
Additionally, client action functions passed to action/formAction props do not execute.
Estimated Impact
~14 test failures.
Affected Test Suites
test/e2e/next-form/default/pages-dir.test.ts(9 failures)test/e2e/next-form/default/app-dir.test.ts(5 failures)test/e2e/next-form/basepath/next-form-basepath.test.ts(1 failure)
Recommendation
-
Reproduce first in vinext's own test suite. Add a test with a
<Form>component fromnext/formand verify that submission performs soft navigation. Confirm it currently does a full page reload. -
Study the Next.js
<Form>implementation. Search.nextjs-ref/packages/next/src/client/form.tsxto understand how form submissions are intercepted and converted to client-side navigations using the router. -
Implement
<Form>in thenext/formshim. The component needs to: (a) intercept thesubmitevent, (b) serialize form data, (c) userouter.push()orrouter.replace()for the navigation, (d) support client action functions viaaction/formActionprops. -
Handle both App Router and Pages Router. The Form component should work in both contexts.