- 22 Oct, 2025 1 commit
-
-
nextjs-bot authored
-
- 21 Oct, 2025 39 commits
-
-
nextjs-bot authored
-
nextjs-bot authored
-
Jiachi Liu authored
-
Niklas Mischkulnig authored
This PR is the initiative of deprecating the edge runtime. Proxy will default to Node.js runtime, and will not allow runtime config. If the users want to use the edge runtime, they should stay on the Middleware, though we recommend starting the migration. --------- Co-authored-by:
devjiwonchoi <devjiwonchoi@gmail.com> Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Zack Tanner authored
Previously we were only showing this during navigations when caches are bypassed. We want to make it clearer that you are in this state and dev might not work as intended while caches are disabled. This will show the cache bypass status on initial load and will reset the next time a router action occurs that doesn't bypass cache. https://github.com/user-attachments/assets/f82a98c6-b5be-44d0-ba86-e4f7ca7010e4
-
Zack Tanner authored
Fixes an issue that reproduces due to a combination of the log forwarding logic alongside logging out an explicit element. We can add this back in the future once our log forwarding library properly ignores non-enumerable properties.
-
Andrew Clark authored
Makes it more clear that `<Suspense>` and "use cache" are separate approaches for fixing the error, not requirements. <img width="969" height="711" alt="Screenshot 2025-10-21 at 3 09 57 PM" src="https://github.com/user-attachments/assets/34bd2efc-9fee-4aba-82eb-6b395663d765" />
-
Joseph authored
Co-authored-by:
Ismael <ismael@vercel.com> Co-authored-by:
Jiachi Liu <inbox@huozhi.im>
-
Jiwon Choi authored
`--turbopack` flag is not needed for v16 upgrade. --------- Co-authored-by:vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
-
Jiwon Choi authored
When running `next-lint-to-eslint-cli` and ESLint version lower than 9, upgrade to `^9` to ensure full Flat config support.
-
Andrew Clark authored
Follow-up to #85155. Made a mistake in the context-passing logic.
-
Jiwon Choi authored
Improve invalid Proxy/Middleware export error message to: ``` > Build error occurred Error: The file "./proxy.ts" must export a function, either as a default export or as a named "proxy" export. This function is what Next.js runs for every request handled by this proxy (previously called middleware). Why this happens: - You are migrating from `middleware` to `proxy`, but haven't updated the exported function. - The file exists but doesn't export a function. - The export is not a function (e.g., an object or constant). - There's a syntax error preventing the export from being recognized. To fix it: - Ensure this file has either a default or "proxy" function export. Learn more: https://nextjs.org/docs/messages/middleware-to-proxy ``` Turbopack: ``` Error: Turbopack build failed with 1 errors: ./proxy.ts Proxy is missing expected function export name This function is what Next.js runs for every request handled by this proxy (previously called middleware). Why this happens: - You are migrating from `middleware` to `proxy`, but haven't updated the exported function. - The file exists but doesn't export a function. - The export is not a function (e.g., an object or constant). - There's a syntax error preventing the export from being recognized. To fix it: - Ensure this file has either a default or "proxy" function export. Learn more: https://nextjs.org/docs/messages/middleware-to-proxy ``` Closes NEXT-4741
-
Luke Sandberg authored
Improve deobfuscation of 'imported module identifier' and attempt to deobfuscate error messages logged by the server. Before ``` ⨯ TypeError: (0 , __TURBOPACK__imported__module__$5b$project$5d2f$examples$2f$with$2d$turbopack$2f$app$2f$foo$2e$ts__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__.foo) is not a function at Page (app/page.tsx:5:6) 3 | export default function Page() { 4 | /** @ts-ignore */ > 5 | foo(); | ^ 6 | return <h1>Hello, Next.js!</h1>; 7 | } 8 | { ``` after ``` ⨯ TypeError: {imported module ./examples/with-turbopack/app/foo.ts}.foo is not a function at Page (app/page.tsx:5:6) 3 | export default function Page() { 4 | /** @ts-ignore */ > 5 | foo(); | ^ 6 | return <h1>Hello, Next.js!</h1>; 7 | } 8 | { ``` Similarly in devtools before:  after  This is definitely an improvement but i am not sure i put the deobfuscation logic in the best place for the console case. Happy for feedback -
Philippe Serhal authored
### What? These config keys were recently soft-renamed with forward compatibility on the _resolved_ config object: - `experimental.proxyPrefetch` → `experimental.middlewarePrefetch` - `experimental.externalProxyRewritesResolve` → `experimental.externalMiddlewareRewritesResolve` - `skipProxyUrlNormalize` → `skipMiddlewareUrlNormalize` But there was no backwards compatibility on the resolved, which is (arguably) an undocumented breaking change. ### Why? This avoids introducing a last-minute breaking change for providers and other integrations that read the the `.next/` build output files (which is necessary until we all move to the upcoming [Adapter API](https://github.com/vercel/next.js/discussions/77740). ### How? When a new `proxy` config key is set but the old `middleware` name is not, copy the value to the old name on the *resolved* config object. This also adds test coverage for both the existing forward compat (old→new) and the new backwards compat (new→old). Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Andrew Clark authored
The content needs to be updated, too, but for now this just fixes the link and title so it matches the updated error message in #85087.
-
Joseph authored
Removed on v16
-
Sebastian Markbåge authored
This allows React DevTools to show a name for this which doesn't have a url like the fetches. Also, don't set startTime for client resume fetch. The start time for this data didn't start on the server as an MPA nav. The start of the fetch actually is a waterfall and should be shown as such.
-
Niklas Mischkulnig authored
preallocate hashmaps
-
Niklas Mischkulnig authored
Allow `export type ... from "...";`
-
Sebastian Markbåge authored
Follow up to #85158. We shouldn't assign a display name to internal one because now that wins over the one we actually want.
-
Zack Tanner authored
Moves this flag out of experimental so that custom `use cache` handlers can be configured alongside the cache components release.
-
JJ Kasper authored
## Summary - Adds comprehensive route generation and normalization for build-complete adapter hooks - Enhances adapter output types with additional metadata fields (`sourcePage`, `wasmAssets`, `pprChain`, `parentFallbackMode`) - Improves middleware matcher handling and revalidation bypass logic - Adds proper tracing for shared node dependencies across pages and app router modules - Includes `buildId` in adapter context for build identification ## Changes ### Route Generation - Generates complete route manifests with processed regex patterns for headers, redirects, rewrites, and dynamic routes - Converts routes using `@vercel/routing-utils` for consistent formatting - Handles RSC routes (`.rsc` suffix) for app router pages - Supports i18n locale-specific routes and data routes (`/_next/data/[buildId]/...`) - Properly handles static pages with mixed app/pages router setups ### Adapter Output Enhancements - Added `sourcePage` field to all route outputs for tracking original source files - Added `wasmAssets` support for bundled WebAssembly files - Added `pprChain` and `parentFallbackMode` to prerender outputs for PPR support - Enhanced middleware matchers to include processed source and regex patterns - Improved traced assets handling with separate tracking for pages vs app router modules ### Middleware & Revalidation - Standardized middleware matcher format with `source`, `sourceRegex`, `has`, and `missing` fields - Automatically adds `x-prerender-revalidate` header bypass to middleware matchers - Fixed middleware pathname to always be `/_middleware` for consistency ### Asset Tracing - Traces shared node dependencies for bootstrapping (node-environment, require-hook, etc.) - Separate tracing for pages router and app router module contexts - Improved trace ignores for unnecessary files (dev builds, webpack internals, etc.) - Better handling of instrumentation hook assets ### Bug Fixes - Fixed RSC fallback handling for mixed app/pages router builds - Improved 404/500 static page detection with locale support - Better basePath normalization with trailing slash handling - Fixed data route generation for getServerSideProps pages with i18n
-
Jude Gao authored
This PR fixes a critical issue with the `experimental.inlineCss` feature where CSS `url()` references to fonts and other assets would break when CSS was inlined into `<style>` tags instead of being loaded via external `<link>` tags. The problem occurred because relative URLs in CSS are resolved relative to the CSS file's location when loaded externally, but when the CSS is inlined directly into the HTML document, those same relative URLs resolve relative to the HTML document instead, causing 404 errors for fonts and images. We fixed this by detecting when CSS is being prepared for inlining and switching from relative URLs (like `../_next/static/media/font.woff2`) to absolute URLs (like `/_next/static/media/font.woff2`) in both the Webpack and Turbopack bundlers. This ensures that asset references work correctly regardless of whether the CSS is inlined or external, while maintaining the existing optimization of using relative URLs for the default case where CSS is loaded via external stylesheets. The fix is transparent to users and requires no changes to application code—simply enabling `experimental.inlineCss: true` will now work correctly with all CSS asset references. Fixes https://github.com/vercel/next.js/issues/83674 --------- Co-authored-by:
Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
-
Tim Neutkens authored
-
nextjs-bot authored
-
Andrew Clark authored
-
Caleb Webber authored
Co-authored-by:Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
-
Jiachi Liu authored
Co-authored-by:
Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com> Co-authored-by:
Joseph <joseph.chamochumbi@vercel.com>
-
Sebastian "Sebbie" Silbermann authored
-
Sebastian "Sebbie" Silbermann authored
-
Andrew Clark authored
In practical terms, clicking the name of a route segment in the Suspense DevTools should select the child slots of that layout, because when you focus on it, what you're interested in debugging are navigations that occur within the shared layout. So the name we apply to the Activity boundary is actually based on the name of the *parent* segment.
-
Josh Story authored
We previously encoded an invariant with cacheLife that required stale to be greater than expire. This doesn't really make sense because these describe completely different lifetimes. Stale starts from when the client reads the response but expire starts from when the cache entry is created. This removes the the requirement that expire be greater than stale
-
Zack Tanner authored
This removes the `routerBfCache` and enables it automatically when `cacheComponents` is enabled. This leverages `React.Activity` on layout segments to support restoring previously visited UI segments while preserving state.
-
Andrew Clark authored
If a layout or page is marked with "use client", we do not need to pass any runtime params from the server; the client can parse them from the URL, or (in the case of a rewrite) from the x-next-rewritten-path and x-next-rewritten-query headers. This means the client can treat the segment as fully static, and no dynamic request is necessary upon navigation.
-
Wyatt Johnson authored
### What? This refactoring enables the `cacheMaxMemorySize` configuration option to control the memory limits of the default "use cache" handler. ### Why? Previously, the default cache handler was hardcoded to use 50MB of memory, ignoring the user's `cacheMaxMemorySize` configuration. This meant users couldn't: - Disable internal caching when using external CDNs (by setting size to 0) - Customize memory limits based on their deployment environment - Control memory usage for the "use cache" handler ### How? - Extracted cache handler creation into `createDefaultCacheHandler()` factory function - Threaded `cacheMaxMemorySize` through `initializeCacheHandlers()` calls - Harmonized parameter naming (`maxMemoryCacheSize` → `cacheMaxMemorySize`) for consistency with the config - Made `cacheMaxMemorySize` required in type signatures - Added zero-size optimization (returns no-op handler when size=0)
-
Sebastian Markbåge authored
This way the "rsc stream" chunk coming from these can be identified.
-
Sebastian Markbåge authored
The problem is that without a new Promise, when all the awaits are in third party, we'd keep searching down to the inner most which shows `internal params`. We could maybe make the real value of those include all params. But we can also just not dedupe to show the real value.
-
Benjamin Woodruff authored
We've already got output logging for this stuff, and the "compiling" message is too noisy. Only print `Compiling /...` it if the compilation takes more than 3s, stop printing `Compiled in` altogether. After this PR: <img width="1075" height="335" alt="Screenshot 2025-10-20 at 3 15 59 PM" src="https://github.com/user-attachments/assets/34e87d18-8feb-4470-ae11-0d8e4b3a8a6b" /> Removes this line: <img width="1095" height="254" alt="Screenshot 2025-10-20 at 3 17 56 PM" src="https://github.com/user-attachments/assets/76fb795e-760a-4782-889a-dd98bcf09125" />
-
Luke Sandberg authored
This is ignored by turbopack but we also always run with useLightningCss so it isn't harmful to set this. If people are using both webpack and turbopack then setting this is reasonable.
-