[instant] Allow providing user feedback for blocking route errors#90498
[instant] Allow providing user feedback for blocking route errors#90498
Conversation
The code is relevant for user feedback. Its absence indicates no user feedback can be provided.
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Failing test suitesCommit: cde6f09 | About building and testing Next.js
Expand output● server-side dev errors › should show server-side error for gsp page correctly ● server-side dev errors › should show server-side error for gssp page correctly ● server-side dev errors › should show server-side error for dynamic gssp page correctly ● server-side dev errors › should show server-side error for api route correctly ● server-side dev errors › should show server-side error for dynamic api route correctly
Expand output● fetch failures have good stack traces in edge runtime › when awaiting
Expand output● instant validation › requires a static shell if a below a static layout page is configured as blocking › errors in dev
Expand output● Error overlay for hydration errors in App router › should show correct hydration error when extra attributes set on server ● Error overlay for hydration errors in App router › should show correct hydration error when server renders an extra text node in an invalid place ● Error overlay for hydration errors in App router › should show correct hydration error when server renders an extra whitespace in an invalid place ● Error overlay for hydration errors in App router › should only show one hydration error when bad nesting happened - p under p ● Error overlay for hydration errors in App router › should only show one hydration error when bad nesting happened - div under p ● Error overlay for hydration errors in App router › should only show one hydration error when bad nesting happened - div > tr ● Error overlay for hydration errors in App router › should show the highlighted bad nesting html snippet when bad nesting happened ● Error overlay for hydration errors in App router › should show error if script is directly placed under html instead of body
Expand output● Undefined default export › should error if page component does not have default export ● Undefined default export › should error if layout component does not have default export ● Undefined default export › should error if not-found component does not have default export when trigger not-found boundary
Expand output● use-cache-search-params › should show an error when searchParams are used inside of a cached generateMetadata ● use-cache-search-params › should show an error when searchParams are used inside of a cached generateViewport
Expand output● server-navigation-error › pages router › should error on navigation API redirect ● server-navigation-error › pages router › should error on navigation API notFound ● server-navigation-error › middleware › should error on navigation API redirect ● server-navigation-error › middleware › should error on navigation API not-found
Expand output● serialize-circular-error › should serialize the object from server component in console correctly ● serialize-circular-error › should serialize the object from client component in console correctly
Expand output● ReactRefreshRegression › shows an overlay for a server-side error
Expand output● ReactRefreshRegression › shows an overlay for a server-side error
Expand output● Validations for › When rendering from a Server Component › Rendering directly › warns if the child is a synchronous server component ● Validations for › When rendering from a Server Component › Rendering directly › warns and throws an error if the child is an asynchronous server component ● Validations for › When rendering from a Server Component › Rendering directly › warns if the child is a lazy component ● Validations for › When rendering from a Server Component › Rendering a Client Component that renders › throws an error if the child is an asynchronous server component ● Validations for › When rendering from a Client Component › errors if there are no children ● Validations for › When rendering from a Client Component › errors if there are multiple children ● Validations for › When rendering from a Client Component › warns and throws an error if the child is lazy JSX
Expand output● ReactRefreshLogBox › module init error not shown ● ReactRefreshLogBox › non-Error errors are handled properly ● ReactRefreshLogBox › should show anonymous frames from stack trace ● ReactRefreshLogBox › should collapse nodejs internal stack frames from stack trace
Expand output● next-link › errors on invalid href ● next-link › invalid
Expand output● instant validation › requires a static shell if a below a static layout page is configured as blocking › errors in dev
Expand output● Validations for › When rendering from a Server Component › Rendering directly › warns if the child is a synchronous server component ● Validations for › When rendering from a Server Component › Rendering directly › warns and throws an error if the child is an asynchronous server component ● Validations for › When rendering from a Server Component › Rendering directly › warns if the child is a lazy component ● Validations for › When rendering from a Server Component › Rendering a Client Component that renders › throws an error if the child is an asynchronous server component ● Validations for › When rendering from a Client Component › errors if there are no children ● Validations for › When rendering from a Client Component › errors if there are multiple children ● Validations for › When rendering from a Client Component › warns and throws an error if the child is lazy JSX
Expand output● Cache Components Fallback Validation › should warn about missing Suspense when accessing params if static params are partially known at build time ● Cache Components Fallback Validation › should warn about missing Suspense when accessing params if static params are entirely missing at build time
Expand output● Cache Components Errors › Dev › Dynamic Metadata - Static Route › should show a collapsed redbox error ● Cache Components Errors › Dev › Dynamic Metadata - Error Route › should show a collapsed redbox error ● Cache Components Errors › Dev › Dynamic Metadata - Static Route With Suspense › should show a collapsed redbox error ● Cache Components Errors › Dev › Dynamic Viewport - Static Route › should show a collapsed redbox error ● Cache Components Errors › Dev › Dynamic Viewport - Dynamic Route › should show a collapsed redbox error ● Cache Components Errors › Dev › Dynamic Root › should show a collapsed redbox with two errors ● Cache Components Errors › Dev › Sync Dynamic Platform › With Fallback - Math.random() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync Dynamic Platform › Without Fallback - Math.random() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync Dynamic Request › client searchParams › should show a collapsed redbox with a sync access error ● Cache Components Errors › Dev › Sync Dynamic Request › client params › should show a collapsed redbox with a sync access error ● Cache Components Errors › Dev › Error Attribution with Sync IO › Guarded RSC with unguarded Client sync IO › should show a collapsed redbox error ● Cache Components Errors › Dev › Error Attribution with Sync IO › Unguarded RSC with guarded Client sync IO › should show a collapsed redbox error ● Cache Components Errors › Dev › Error Attribution with Sync IO › unguarded RSC with unguarded Client sync IO › should show a collapsed redbox error ● Cache Components Errors › Dev › Inside ● Cache Components Errors › Dev › Inside ● Cache Components Errors › Dev › Inside ● Cache Components Errors › Dev › Inside ● Cache Components Errors › Dev › Inside ● Cache Components Errors › Dev › Inside ● Cache Components Errors › Dev › Inside ● Cache Components Errors › Dev › Inside ● Cache Components Errors › Dev › Inside ● Cache Components Errors › Dev › Inside ● Cache Components Errors › Dev › With ● Cache Components Errors › Dev › With ● Cache Components Errors › Dev › With ● Cache Components Errors › Dev › Sync IO - Current Time - Date() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Current Time - Date.now() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Current Time - new Date() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Random - Math.random() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Web Crypto - getRandomValue() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Web Crypto - randomUUID() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Node Crypto - generateKeyPairSync() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Node Crypto - generateKeySync() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Node Crypto - generatePrimeSync() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Node Crypto - getRandomValues() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Node Crypto - random-bytes() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Node Crypto - random-fill-sync() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Node Crypto - random-int-between() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Node Crypto - random-int-up-to() › should show a collapsed redbox error ● Cache Components Errors › Dev › Sync IO - Node Crypto - random-uuid › should show a collapsed redbox error ● Cache Components Errors › Dev › IO accessed in Client Components › should show a collapsed redbox error
Expand output● after() in static pages › runs after during build |
Stats from current PR🔴 1 regression
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles: **399 kB** → **399 kB**
|
| Canary | PR | Change | |
|---|---|---|---|
| middleware-b..fest.js gzip | 762 B | 762 B | ✓ |
| Total | 762 B | 762 B | ✓ |
Build Details
Build Manifests
| Canary | PR | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 452 B | 450 B | ✓ |
| Total | 452 B | 450 B | ✅ -2 B |
📦 Webpack
Client
Main Bundles
| Canary | PR | Change | |
|---|---|---|---|
| 5528-HASH.js gzip | 5.54 kB | N/A | - |
| 6280-HASH.js gzip | 57.5 kB | N/A | - |
| 6335.HASH.js gzip | 169 B | N/A | - |
| 912-HASH.js gzip | 4.59 kB | N/A | - |
| e8aec2e4-HASH.js gzip | 62.6 kB | N/A | - |
| framework-HASH.js gzip | 59.7 kB | 59.7 kB | ✓ |
| main-app-HASH.js gzip | 255 B | 254 B | ✓ |
| main-HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
| webpack-HASH.js gzip | 1.68 kB | 1.68 kB | ✓ |
| 262-HASH.js gzip | N/A | 4.59 kB | - |
| 2889.HASH.js gzip | N/A | 169 B | - |
| 5602-HASH.js gzip | N/A | 5.55 kB | - |
| 6948ada0-HASH.js gzip | N/A | 62.6 kB | - |
| 9544-HASH.js gzip | N/A | 58.3 kB | - |
| Total | 231 kB | 232 kB |
Polyfills
| Canary | PR | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 39.4 kB | 39.4 kB | ✓ |
| Total | 39.4 kB | 39.4 kB | ✓ |
Pages
| Canary | PR | Change | |
|---|---|---|---|
| _app-HASH.js gzip | 194 B | 194 B | ✓ |
| _error-HASH.js gzip | 183 B | 180 B | 🟢 3 B (-2%) |
| css-HASH.js gzip | 331 B | 330 B | ✓ |
| dynamic-HASH.js gzip | 1.81 kB | 1.81 kB | ✓ |
| edge-ssr-HASH.js gzip | 256 B | 256 B | ✓ |
| head-HASH.js gzip | 351 B | 352 B | ✓ |
| hooks-HASH.js gzip | 384 B | 383 B | ✓ |
| image-HASH.js gzip | 580 B | 581 B | ✓ |
| index-HASH.js gzip | 260 B | 260 B | ✓ |
| link-HASH.js gzip | 2.5 kB | 2.5 kB | ✓ |
| routerDirect..HASH.js gzip | 320 B | 319 B | ✓ |
| script-HASH.js gzip | 386 B | 386 B | ✓ |
| withRouter-HASH.js gzip | 315 B | 315 B | ✓ |
| 1afbb74e6ecf..834.css gzip | 106 B | 106 B | ✓ |
| Total | 7.97 kB | 7.97 kB | ✅ -2 B |
Server
Edge SSR
| Canary | PR | Change | |
|---|---|---|---|
| edge-ssr.js gzip | 125 kB | 125 kB | ✓ |
| page.js gzip | 252 kB | 253 kB | ✓ |
| Total | 377 kB | 378 kB |
Middleware
| Canary | PR | Change | |
|---|---|---|---|
| middleware-b..fest.js gzip | 617 B | 618 B | ✓ |
| middleware-r..fest.js gzip | 156 B | 155 B | ✓ |
| middleware.js gzip | 43.9 kB | 44 kB | ✓ |
| edge-runtime..pack.js gzip | 842 B | 842 B | ✓ |
| Total | 45.5 kB | 45.7 kB |
Build Details
Build Manifests
| Canary | PR | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 715 B | 718 B | ✓ |
| Total | 715 B | 718 B |
Build Cache
| Canary | PR | Change | |
|---|---|---|---|
| 0.pack gzip | 3.98 MB | 3.99 MB | 🔴 +9.69 kB (+0%) |
| index.pack gzip | 103 kB | 103 kB | ✓ |
| index.pack.old gzip | 103 kB | 102 kB | ✓ |
| Total | 4.19 MB | 4.2 MB |
🔄 Shared (bundler-independent)
Runtimes
| Canary | PR | Change | |
|---|---|---|---|
| app-page-exp...dev.js gzip | 318 kB | 318 kB | ✓ |
| app-page-exp..prod.js gzip | 169 kB | 169 kB | ✓ |
| app-page-tur...dev.js gzip | 318 kB | 318 kB | ✓ |
| app-page-tur..prod.js gzip | 168 kB | 168 kB | ✓ |
| app-page-tur...dev.js gzip | 314 kB | 315 kB | ✓ |
| app-page-tur..prod.js gzip | 166 kB | 166 kB | ✓ |
| app-page.run...dev.js gzip | 315 kB | 315 kB | ✓ |
| app-page.run..prod.js gzip | 167 kB | 167 kB | ✓ |
| app-route-ex...dev.js gzip | 70.7 kB | 70.7 kB | ✓ |
| app-route-ex..prod.js gzip | 49.1 kB | 49.1 kB | ✓ |
| app-route-tu...dev.js gzip | 70.7 kB | 70.7 kB | ✓ |
| app-route-tu..prod.js gzip | 49.2 kB | 49.2 kB | ✓ |
| app-route-tu...dev.js gzip | 70.3 kB | 70.3 kB | ✓ |
| app-route-tu..prod.js gzip | 48.9 kB | 48.9 kB | ✓ |
| app-route.ru...dev.js gzip | 70.2 kB | 70.2 kB | ✓ |
| app-route.ru..prod.js gzip | 48.9 kB | 48.9 kB | ✓ |
| dist_client_...dev.js gzip | 324 B | 324 B | ✓ |
| dist_client_...dev.js gzip | 326 B | 326 B | ✓ |
| dist_client_...dev.js gzip | 318 B | 318 B | ✓ |
| dist_client_...dev.js gzip | 317 B | 317 B | ✓ |
| pages-api-tu...dev.js gzip | 43.2 kB | 43.2 kB | ✓ |
| pages-api-tu..prod.js gzip | 32.9 kB | 32.9 kB | ✓ |
| pages-api.ru...dev.js gzip | 43.2 kB | 43.2 kB | ✓ |
| pages-api.ru..prod.js gzip | 32.8 kB | 32.8 kB | ✓ |
| pages-turbo....dev.js gzip | 52.5 kB | 52.5 kB | ✓ |
| pages-turbo...prod.js gzip | 38.5 kB | 38.5 kB | ✓ |
| pages.runtim...dev.js gzip | 52.5 kB | 52.5 kB | ✓ |
| pages.runtim..prod.js gzip | 38.4 kB | 38.4 kB | ✓ |
| server.runti..prod.js gzip | 62 kB | 62 kB | ✓ |
| Total | 2.81 MB | 2.81 MB |
📝 Changed Files (8 files)
Files with changes:
app-page-exp..ntime.dev.jsapp-page-exp..time.prod.jsapp-page-tur..ntime.dev.jsapp-page-tur..time.prod.jsapp-page-tur..ntime.dev.jsapp-page-tur..time.prod.jsapp-page.runtime.dev.jsapp-page.runtime.prod.js
View diffs
app-page-exp..ntime.dev.js
failed to diffapp-page-exp..time.prod.js
Diff too large to display
app-page-tur..ntime.dev.js
failed to diffapp-page-tur..time.prod.js
Diff too large to display
app-page-tur..ntime.dev.js
failed to diffapp-page-tur..time.prod.js
Diff too large to display
app-page.runtime.dev.js
failed to diffapp-page.runtime.prod.js
Diff too large to display
📎 Tarball URL
next@https://vercel-packages.vercel.app/next/prs/90498/next
00f821a to
2f6d712
Compare

These errors previously had no error codes so users couldn't provide feedback.
To allow feedback, we need to ensure we generate a code and send it to the browser.
Generating a code just requires moving the error instantiation so that the transform sees the message as a literal not variable.
Currently we send errors as-is via React's Flight protocol which doesn't transport arbitrary properties on error instances. We now send the errors and a mapping from error instance to code. Since Flight transports referential equality for duplicate objects, we can use the map to restore the error codes manually.