- 11 Sep, 2025 16 commits
-
-
nextjs-bot authored
-
Mohammad Nedaeifard authored
fix _nextjsDevtools csp error which happens in development environment after enabling csp and following the current documents. Full Error: - Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'nonce-YmYyMTZmYTQtMzgxNy00ZjYwLWIwMGQtYjBmYjJjNGYzZWQ1' 'unsafe-inline'". Note that 'unsafe-inline' is ignored if either a hash or nonce value is present in the source list. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Co-authored-by:
Joseph <joseph.chamochumbi@vercel.com>
-
Hendrik Liebau authored
Creating the client-side debug channel when `experimental.reactDebugChannel` is falsy went unnoticed in the [original PR](https://github.com/vercel/next.js/pull/82748), because this doesn't provoke any obvious errors. The debug info is still correctly received through the main RSC stream. But it does create a memory leak, because it prevents React from closing the Flight response. On the server side, we were already guarding the feature properly using the feature flag.
-
Luke Sandberg authored
Right now we construct `Request` objects eagerly when analyzing modules. This is on the critical path for analysis and can be expensive if there are a lot of exports (See [thread](https://vercel.slack.com/archives/C06PPGZ0FD3/p1757517287294729)) Instead just store the string and `parse` when resolving the reference. This should have identical caching semantics and by deferring the work we may be able to avoid it altogether if certain references never get resolved due to `sideEffects` configuration.
-
nextjs-bot authored
Co-authored-by:Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
-
Tim Neutkens authored
## What? Use sync fs methods for reading/writing manifests after a Turbopack writeToDisk. Next step will be not calling it when nothing changed. Before: ``` GET / 200 in 41ms GET / 200 in 54ms GET / 200 in 57ms GET / 200 in 165ms GET / 200 in 44ms GET / 200 in 52ms GET / 200 in 42ms GET / 200 in 50ms GET / 200 in 39ms GET / 200 in 53ms GET / 200 in 39ms GET / 200 in 49ms GET / 200 in 40ms GET / 200 in 49ms GET / 200 in 40ms GET / 200 in 54ms GET / 200 in 39ms GET / 200 in 52ms GET / 200 in 47ms GET / 200 in 50ms GET / 200 in 45ms GET / 200 in 59ms GET / 200 in 44ms GET / 200 in 55ms GET / 200 in 46ms GET / 200 in 51ms ``` After: ``` GET / 200 in 31ms GET / 200 in 29ms GET / 200 in 32ms GET / 200 in 33ms GET / 200 in 33ms GET / 200 in 34ms GET / 200 in 32ms GET / 200 in 30ms GET / 200 in 33ms GET / 200 in 30ms GET / 200 in 31ms GET / 200 in 32ms GET / 200 in 31ms GET / 200 in 31ms GET / 200 in 30ms GET / 200 in 33ms GET / 200 in 33ms GET / 200 in 32ms GET / 200 in 29ms GET / 200 in 30ms GET / 200 in 36ms GET / 200 in 35ms GET / 200 in 34ms GET / 200 in 32ms GET / 200 in 30ms ```
-
nextjs-bot authored
Co-authored-by:Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
-
Joshua Hannaford authored
# Improve BytePos encoding for large source maps This PR enhances the BytePos encoding mechanism in scope-hoisted modules to handle larger source maps. The previous implementation had limitations when dealing with large byte positions, which could cause errors during source map generation. ## Changes: - Added a lookup table to store byte positions and module indexes that are too large for the standard encoding - Implemented a continuation flag (using the highest bit) to indicate when a position is stored in the lookup table - Added a sign extension flag to properly handle padded values - Updated all relevant code paths to use the new encoding/decoding mechanism - Adjusted the header width calculation to accommodate the new flags - Made the encoding/decoding functions thread-safe with Arc<Mutex<>> This approach allows us to handle arbitrarily large byte positions while maintaining backward compatibility with the existing encoding scheme for smaller values to ensure performance stays as optimal as possible. Fixes PACK-5244 Fixes #82584
-
Wyatt Johnson authored
### What? Removes the temporary constraint that required `clientParamParsing` to be enabled for Resume Data Cache (RDC) for Navigations in PPR-enabled applications. ### Why? The upstream builder configuration issue that caused invalid query parameters to be passed to resume lambdas has been resolved. The `clientParamParsing` requirement was a temporary workaround that can now be safely removed. This enhancement allows more users on PPR to automatically benefit from RDC for RSC requests, improving performance by eliminating waterfalls when resuming prerendered pages without requiring additional feature flags. ### How? - Removed the `clientParamParsing` check from both build configuration and app-page template - Simplified the feature enablement logic for RDC in navigation scenarios The change affects two files: - `packages/next/src/build/index.ts`: Build-time configuration logic - `packages/next/src/build/templates/app-page.ts`: Runtime navigation support detection NAR-385
-
Hendrik Liebau authored
The `build-and-test` workflow runs on `canary` are currently annotated with the following error ([x-ref](https://github.com/vercel/next.js/actions/runs/17629372493)): ``` Error when evaluating 'strategy' for job 'test-rspack-production'. .github/workflows/build_and_test.yml (Line: 412, Col: 13): Matrix exclude key 'react' does not match any key within the matrix ``` This addresses the issue for `test-rspack-production`, and also fixes inconsistencies in other jobs regarding the handling of this matrix dimension.
-
nextjs-bot authored
-
Tim Neutkens authored
## What? Removes imports from the app-ssr layer that cause transitive dependencies to be included during compilation in development. For the trace that I received from an application there was quite a bit of overhead for them because of this issue. Trace: 
-
Tim Neutkens authored
## What? Currently each `next/font` import would cause the capsize-font-metrics json to be loaded which is 4.2Mb so not super fast to load on machines with a slower filesystem. On one trace provided it showed 100-160ms spent on loading for each `next/font` import (each individual font imported). On my machine it was more like 10ms per font imported. Worth fixing either way. --------- Co-authored-by:Luke Sandberg <lukesandberg@users.noreply.github.com>
-
nextjs-bot authored
-
Tim Neutkens authored
## What? Currently Route Handlers trigger a compile for the client-side JS runtime but it's not required when compiling route handlers.
-
Niklas Mischkulnig authored
Change the fix from #83334 to not have a "CSS environment" inside of every environment. I don't think that this makes sense, and it also makes the implementation more complicated. ```diff pub struct Environment { execution: ExecutionEnvironment, + css_environment: ResolvedVc<BrowserEnvironment>, } ``` Instead, we can just pass the client's `Environment` when we create the server's transform rules, to use the client's browserslist config for styled-jsx. #83334 was also missing a test case I recommend the review each commits individually.
-
- 10 Sep, 2025 7 commits
-
-
nextjs-bot authored
-
Jiachi Liu authored
-
nextjs-bot authored
-
Niklas Mischkulnig authored
Port the unit tests from https://github.com/vercel/nft/tree/941be1cb3b9d38fbc99a8a6f07af568a64ed0f12/test/unit
-
Jiwon Choi authored
Current metadata files are compiled to `route.js` files. This happens not only to metadata API (e.g., `icon.tsx`), but to static files as well, which is unnecessary. In development, this leads to confusing logs such as: ``` Compiled /favicon.ico in ...ms ``` Users may reasonably wonder why Next.js is "compiling" a static file. Static files can be served directly from the filesystem, like `_next/static/` assets. Therefore, in development, skip compilation of static metadata files and serve them as static. For production, we can follow up in a separate PR to skip compiling the `route.js` files and emit static files to the dist directory, and also serve from the filesystem there as well. Closes [NEXT-4338](https://linear.app/vercel/issue/NEXT-4338) --- TODO(s) to follow up: - Fix Cache Components failing build with metadata files inside the dynamic route. - x-ref: [slack thread](https://vercel.slack.com/archives/C06N3AXRQ82/p1738053808940719) --------- Co-authored-by:
Jiachi Liu <inbox@huozhi.im>
-
Vercel Release Bot authored
Co-authored-by:nextjs-bot <it+nextjs-bot@vercel.com>
-
Josh Story authored
Currently we only abort React renders that are prerendered so this change in practice only affects prerendering. The intent is to not report unhandledRejections that are downstream of an abort because the signal these errors provide is very limited. If you do have unrelated unhandled rejections they'll usually show up before aborting or in a dynamic page render so even if they are incidentally supressed in the prerender context you should still be able to observe them. Arguably we should go further and never report unhandled rejections because there are still valid patterns where you initiate work prospectively and then abandon it by choosing a fork or by returning early (i.e. notFound()). This change doesn't attempt to cover every possible case. The implementation is a bit intense. We need the ability to stop propagating the event which is not natively supported with Node's EventEmitter interface. Instead we patch the listener methods to delegate the filtering to an inner listener queue. If you add/remove or otherwise manipulate the listener list we always ensure our listener is first and can opt to omit propagating the event. If you want to uninstall the this patch you just need to unregister this listener specifically which can be accessing used `process.listeners('unhandledRejection')[0]` This patch only exists for the node environment because we do not do any prerendering in edge runtimes. In the future if we add aborting to environments like edge runtime we may need an alternative solution to this problem
-
- 09 Sep, 2025 17 commits
-
-
nextjs-bot authored
-
Tim Neutkens authored
## What? The Watchpack instance created defaulted to `aggregateTimeout: 200` which causes 200ms of dead time during bootup, affecting the `ready in` logline. Before: ``` ✓ Starting... ✓ Ready in 583ms ``` After: ``` ✓ Starting... ✓ Ready in 355ms // -39.1% ``` Next up: - `~50ms`: Remove loading webpack when Turbopack is used (it still gets required currently for `next.config.js`) - `~110ms`: Figure out how to avoid loading TypeScript which is used to check `tsconfig.json` options.
-
nextjs-bot authored
-
nextjs-bot authored
-
Tim Neutkens authored
## What? Don't require/call loadJsConfig when using Turbopack, as it's handled internally. loadJsConfig is one of the places where TypeScript gets loaded. There's still the TS verify as well, this narrows the amount of places where TypeScript gets loaded to make it easier to remove that loading of TypeScript in a future PR.
-
Tim Neutkens authored
## What? Follow-up to #83609. hot-reloader-webpack was imported from hot-reloader-turbopack, causing it to be loaded even when not used.
-
Tim Neutkens authored
## What? Currently Babel always gets loaded in order to check for a babel config. This event is no longer that useful to track so removing it in favor of performance.
-
JJ Kasper authored
Continues https://github.com/vercel/next.js/pull/82919 from testing fixing `fallback` value missing the extension and `/` app route not being mapping to it's output file correctly. This also adds a test suite with PPR enabled to catch these cases.
-
Tim Neutkens authored
## What? Fixes a logic bug caught by the code review bot: https://github.com/vercel/next.js/pull/83555#discussion_r2329668930
-
Tim Neutkens authored
## What? Currently both hot-reloader paths are loaded, this ensures HotReloaderWebpack does not get loaded when using Turbopack. Note: This does not solve webpack being required because it's still loaded in `config-shared`, that's for a future follow-up.
-
Joseph authored
Closes: https://linear.app/vercel/issue/DOC-5040/usepathname-and-rewrites
-
Tim Neutkens authored
## What? Makes sure `build/entries` is not loaded in development (has transitive requires that take some time)
-
Hendrik Liebau authored
In `next dev`, we're currently ignoring the exit code of the spawned child process, and always exiting with `0` instead. We should exit the process with the child's exit code instead. This is relevant when the `next.config.js` is invalid, for example.
-
Tom Moses authored
Fixed import statements in tutorial code to point to files in the correct folders. Co-authored-by:Joseph <joseph.chamochumbi@vercel.com>
-
Tim Neutkens authored
## What? Move build-indicator test to be isolated using the modern test utils. It's still flaking so ruling out the other causes.
-
Joseph authored
$ in the command example makes it annoying to copy paste
-
Niklas Mischkulnig authored
-