-
Notifications
You must be signed in to change notification settings - Fork 27.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix custom 404 page when concurrentFeatures is enabled #31059
Conversation
This comment has been minimized.
This comment has been minimized.
aa53bac
to
4b95f7f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Failing test suitesCommit: baf7ef4 test/development/basic/misc.test.ts
Expand output● misc basic dev tests › Development Logs › should warn when prefetch is true
● misc basic dev tests › Development Logs › should not warn when prefetch is false
test/integration/react-streaming-and-server-components/test/index.test.js
Expand output● concurrentFeatures - prod › should have clientInfo in middleware manifest
● concurrentFeatures - prod › should support React.lazy and dynamic imports
● concurrentFeatures - prod › should render the correct html
● concurrentFeatures - prod › should suspense next/link on server side
● concurrentFeatures - prod › should suspense next/image on server side
● concurrentFeatures - prod › should support multi-level server component imports
● concurrentFeatures - dev › should support React.lazy and dynamic imports
● concurrentFeatures - dev › should render the correct html
● concurrentFeatures - dev › should suspense next/link on server side
● concurrentFeatures - dev › should suspense next/image on server side
● concurrentFeatures - dev › should support multi-level server component imports
● CSS dev › should include global styles under
● CSS dev › should include global styles with
● CSS prod › should include global styles under
● CSS prod › should include global styles with
test/integration/react-18/test/index.test.js
Expand output● Concurrent mode › concurrentFeatures is enabled (dev) › should resolve suspense modules on server side if suspense
● Concurrent mode › concurrentFeatures is enabled (dev) › should resolve suspense on server side if not suspended on server
● Concurrent mode › concurrentFeatures is enabled (dev) › should resolve suspense on server side if suspended on server
● Concurrent mode › concurrentFeatures is enabled (dev) › should hydrate suspenses on client side if suspended on server
● Concurrent mode › concurrentFeatures is enabled (dev) › should drain the entire response
● Concurrent mode › concurrentFeatures is enabled (dev) › should stream to users
● Concurrent mode › concurrentFeatures is enabled (dev) › should not stream to bots
● Concurrent mode › concurrentFeatures is enabled (prod) › should resolve suspense modules on server side if suspense
● Concurrent mode › concurrentFeatures is enabled (prod) › should resolve suspense on server side if not suspended on server
● Concurrent mode › concurrentFeatures is enabled (prod) › should resolve suspense on server side if suspended on server
● Concurrent mode › concurrentFeatures is enabled (prod) › should hydrate suspenses on client side if suspended on server
● Concurrent mode › concurrentFeatures is enabled (prod) › should drain the entire response
|
patch 404 as non-streaming in dev
baf7ef4
to
bbcd885
Compare
Stats from current PRDefault Build (Decrease detected ✓)General Overall increase
|
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
buildDuration | 18.2s | 18.1s | -23ms |
buildDurationCached | 3.6s | 4s | |
nodeModulesSize | 332 MB | 332 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.889 | 2.951 | |
/ avg req/sec | 865.4 | 847.11 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.368 | 1.384 | |
/error-in-render avg req/sec | 1827.77 | 1806.19 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
450.HASH.js gzip | 179 B | 179 B | ✓ |
framework-HASH.js gzip | 42.2 kB | 42.2 kB | ✓ |
main-HASH.js gzip | 28 kB | 28 kB | ✓ |
webpack-HASH.js gzip | 1.45 kB | 1.45 kB | ✓ |
Overall change | 71.9 kB | 71.9 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
_app-HASH.js gzip | 1.23 kB | 1.23 kB | ✓ |
_error-HASH.js gzip | 194 B | 194 B | ✓ |
amp-HASH.js gzip | 312 B | 312 B | ✓ |
css-HASH.js gzip | 327 B | 327 B | ✓ |
dynamic-HASH.js gzip | 2.38 kB | 2.38 kB | ✓ |
head-HASH.js gzip | 350 B | 350 B | ✓ |
hooks-HASH.js gzip | 635 B | 635 B | ✓ |
image-HASH.js gzip | 4.44 kB | 4.44 kB | ✓ |
index-HASH.js gzip | 263 B | 263 B | ✓ |
link-HASH.js gzip | 1.87 kB | 1.87 kB | ✓ |
routerDirect..HASH.js gzip | 321 B | 321 B | ✓ |
script-HASH.js gzip | 383 B | 383 B | ✓ |
withRouter-HASH.js gzip | 318 B | 318 B | ✓ |
334f979574ae..6f4.css gzip | 106 B | 106 B | ✓ |
Overall change | 13.1 kB | 13.1 kB | ✓ |
Client Build Manifests
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
_buildManifest.js gzip | 459 B | 459 B | ✓ |
Overall change | 459 B | 459 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
index.html gzip | 522 B | 522 B | ✓ |
link.html gzip | 535 B | 535 B | ✓ |
withRouter.html gzip | 515 B | 515 B | ✓ |
Overall change | 1.57 kB | 1.57 kB | ✓ |
Default Build with SWC (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
buildDuration | 21.1s | 19.3s | -1.8s |
buildDurationCached | 3.6s | 3.6s | |
nodeModulesSize | 332 MB | 332 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.98 | 3.004 | |
/ avg req/sec | 838.79 | 832.22 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.391 | 1.41 | |
/error-in-render avg req/sec | 1796.69 | 1773.16 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
450.HASH.js gzip | 179 B | 179 B | ✓ |
framework-HASH.js gzip | 42.3 kB | 42.3 kB | ✓ |
main-HASH.js gzip | 28.2 kB | 28.2 kB | ✓ |
webpack-HASH.js gzip | 1.43 kB | 1.43 kB | ✓ |
Overall change | 72.1 kB | 72.1 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
_app-HASH.js gzip | 1.22 kB | 1.22 kB | ✓ |
_error-HASH.js gzip | 180 B | 180 B | ✓ |
amp-HASH.js gzip | 305 B | 305 B | ✓ |
css-HASH.js gzip | 321 B | 321 B | ✓ |
dynamic-HASH.js gzip | 2.38 kB | 2.38 kB | ✓ |
head-HASH.js gzip | 342 B | 342 B | ✓ |
hooks-HASH.js gzip | 622 B | 622 B | ✓ |
image-HASH.js gzip | 4.46 kB | 4.46 kB | ✓ |
index-HASH.js gzip | 256 B | 256 B | ✓ |
link-HASH.js gzip | 1.91 kB | 1.91 kB | ✓ |
routerDirect..HASH.js gzip | 314 B | 314 B | ✓ |
script-HASH.js gzip | 375 B | 375 B | ✓ |
withRouter-HASH.js gzip | 309 B | 309 B | ✓ |
334f979574ae..6f4.css gzip | 106 B | 106 B | ✓ |
Overall change | 13.1 kB | 13.1 kB | ✓ |
Client Build Manifests
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
_buildManifest.js gzip | 460 B | 460 B | ✓ |
Overall change | 460 B | 460 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | huozhi/next.js fix/streaming-404 | Change | |
---|---|---|---|
index.html gzip | 521 B | 521 B | ✓ |
link.html gzip | 534 B | 534 B | ✓ |
withRouter.html gzip | 515 B | 515 B | ✓ |
Overall change | 1.57 kB | 1.57 kB | ✓ |
x-ref: #30424 (comment)
This fix the custom 404 is not rendering properly and can’t be built in web runtime when
concurrentFeatures
is enabled. We force 404 page to be rendered outside of middleware ssr. Then it could be the real fallback 404 page in next-server when any routes is not macthed.Will check 500 related after #31057 is landed.
Bug