- 14 Aug, 2025 15 commits
-
-
nextjs-bot authored
-
Ben Gubler authored
<!-- 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 ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### 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 # -->
-
Niklas Mischkulnig authored
<!-- 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 ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### 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 # -->
-
Luke Sandberg authored
Change our `global` rewrite to use a non-shadowable property on `__turbopack_context__` The previous rewrite to `globalThis` would break if there was a local declaration of `let globalThis` which could either trigger a TDZ error or simply evaluate to the wrong value. Closes PACK-5256 Fixes #82632
-
Niklas Mischkulnig authored
Reverts https://github.com/vercel/next.js/pull/82256 because there appears to be a race condition (even in the unit tests) https://vercel.slack.com/archives/C04KC8A53T7/p1755180908771559
-
nextjs-bot authored
-
Sebastian "Sebbie" Silbermann authored
-
Hendrik Liebau authored
When revalidating a tag or path with a server action, we do want to log any fetches that are made during the subsequent rerendering, when [fetch logging](https://nextjs.org/docs/app/api-reference/config/next-config-js/logging#fetching) is enabled. This got accidentally broken in #64746, where we wrote: > [...] this ensures we don't keep tracking fetch metrics after the request has ended as we only report on request end That's incorrect though, because we report fetch metrics when the _response_ is closed, and not the request: https://github.com/vercel/next.js/blob/0bd7423844e218b19537880a7fa4314749fdf57d/packages/next/src/server/dev/next-dev-server.ts#L530-L546 This is crucial for server actions, when the request is likely already closed while we're rerendering and streaming the response to the client. fixes #80444 closes NAR-307
-
Tobias Koppers authored
### What? add a `spawn` method in turbo_tasks that allows to spawn a async tokio task with the right task locals, spans, etc.
-
Steven authored
Add a warning to Next.js 15.5 to prepare for Next.js 16 when `images.localPatterns` is undefined and the user attempted to optimize a `src` image with a query string, such as ```jsx <Image src="/api/user?id=1" width="50" height="50" /> ```
-
Tobias Koppers authored
### What? Do not run a compaction when opening the DB. We are already busy when starting up, so no need to add more work to that.
-
Niklas Mischkulnig authored
The source content was somethings incorrect with scope hoisting on Turbopack: <img width="2018" height="721" alt="image" src="https://github.com/user-attachments/assets/e2e1bf1c-2a84-4acb-8388-a809670b4902" /> Fix is in https://github.com/swc-project/swc-sourcemap/pull/7
-
nextjs-bot authored
-
Tobias Koppers authored
### What? Avoid a property on the module object by using a WeakMap
-
Niklas Mischkulnig authored
Edge functions with route `/` had `"name": "/"` in the `middleware-manifest.json`. When deploying to Vercel, this wouldn't work as the Vercel builder turned that into `"name": ""`. For the root function, Webpack emits a name like `"app/page"` or `"pages/index"`. This aligns Turbopack with Webpack I think the name itself can be pretty arbitrary. As long as the `_ENTRIES` access and the middleware manifests agree (which is covered by the regular e2e tests), and as long as it's not literally `"/"` which breaks on Vercel. Closes PACK-5245
-
- 13 Aug, 2025 25 commits
-
-
nextjs-bot authored
-
Jam Balaya authored
## Summary Fix typos and spelling errors in various MDX documentation files to improve clarity and consistency. Documentation: - Standardize 'cacheable' spelling across self-hosting guide - Correct 'potentionally' to 'potentially' in image component references - Fix 'unecessary' to 'unnecessary' in use-link-status guide ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guideCo-authored-by:
Joseph <joseph.chamochumbi@vercel.com>
-
Jiachi Liu authored
-
Guo Ci authored
<!-- 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 ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### 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>
-
Joseph authored
Attempt at fixing from our side: https://github.com/vercel/next.js/issues/82577 Rather, the issue is that when the project is at the root of the file system - `findRootDir` loops indefinitely, and we keep pushing to the lockFiles found. I also noticed the warning claims we use the last lockfile found, but we return `dirname(lockfile)` - that is the first lock file found. Regardless, when using this project setup: ```console . ├── apps │ └── frontend │ ├── README.md │ ├── next.config.ts │ ├── package.json │ ├── pnpm-lock.yaml │ ├── src │ │ └── app │ │ ├── globals.css │ │ ├── layout.tsx │ │ └── page.tsx │ └── tsconfig.json ├── package.json ├── pnpm-lock.yaml └── pnpm-workspace.yaml ``` Running `pnpm --filter frontend dev` still ends up in panic: `Error [TurbopackInternalError]: Next.js package not found` - Maybe that's still expected :) As for https://github.com/vercel/next.js/issues/82577 - a way for them to get unblocked is to use a `WORKDIR`. More details on that issue thread. --------- Co-authored-by:
Luke Sandberg <lukesandberg@users.noreply.github.com>
-
nextjs-bot authored
-
Ben Gubler authored
## Overview Generates `.next/types/validator.ts` - a single TypeScript file that validates all route exports using the `satisfies` operator. Replaces the old `next-types-plugin` webpack plugin. ## Why needed - **Turbopack compatibility**: Old webpack plugin didn't work with Turbopack - **Performance**: Single large file vs hundreds of small validation files - **Type safety**: Catches invalid exports like `dynamic = 'invalid-value'` ## Validation Structure ```typescript // Type definitions type PageConfig = { default: React.ComponentType<any> config?: {} generateMetadata?: (props: any, parent: any) => Promise<any> | any dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static' // ... other Next.js exports } // Validation checks // Validate app/page.tsx { const handler = {} as typeof import("../../app/page") handler satisfies PageConfig } ... ``` ## Example Usage ```typescript // app/blog/[slug]/page.tsx export const dynamic = 'some-random-string' // ← Type error caught! export default async function BlogPostPage(props: PageProps<'/blog/[slug]'>) { const params = await props.params return <div>Blog Post: {params.slug}</div> } ``` ## Key Benefits - **Build-time validation**: Catches invalid route exports during TypeScript compilation - **Turbopack support**: Works with both webpack and Turbopack - **Better performance**: One file instead of hundreds of small type guard files -
Vercel Release Bot authored
This auto-generated PR updates the development integration test manifest used when testing Rspack.
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
Niklas Mischkulnig authored
Co-authored-by:vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
-
Hendrik Liebau authored
In #81162 we removed the support for accessing request data synchronously when `experimental.cacheComponents` is enabled. However, we missed updating the `cookies()` and `headers()` promises that are created at runtime to not be "exotic" promises, i.e. promises that also have the cookies/headers methods defined on them. Those two cases are now updated as well with this PR. (Params, search params, and draft mode were already handled correctly in the original PR.) In the next major version we'll remove the support for the legacy synchronous access independent of the `cacheComponents` flag.
-
Luke Sandberg authored
Drop the scare text about not running turbopack in production. Instead clarify that builds are beta and direct people to our documentation site. For example:  Compared to the old notice:  Notably * mission critical applications are a good idea! just be careful with compatibility issues * the source maps issues is fixed! no need to talk about it at all * A discussion of bundle size issues and build caches is being added in #82560 Closes PACK-5237
-
Niklas Mischkulnig authored
Turbopack fails to resolve this ```js function requireOrgPkg(s) { return require(`@org/pkg-${s}`) } ``` which is needed for the case of ```js require(`@img/sharp-${currentArch()}/sharp.node`) ``` -
Sebastian "Sebbie" Silbermann authored
-
Zack Tanner authored
The deprecation warning code is fairly brittle right now since there's a mixture of calling things with `userConfig` and `result`. It was assumed that `userConfig` was the actual user-provided configuration, but it turns out it's actually the default configuration when a user configuration isn't specified. This moves all the deprecation checks to be before we actually do any sort of merging. This restores the intent behind `userConfig` and will prevent deprecation warnings from being logged due to defaults. Alternative to #82593
-
Sebastian "Sebbie" Silbermann authored
Co-authored-by:Hendrik Liebau <mail@hendrik-liebau.de>
-
Andrew Clark authored
When there is no matching route tree in the prefetch cache, before we de-opt to a blocking navigation, we will first attempt to construct an "optimistic" route tree by checking the cache for routes are likely to be similar to the one we're missing. If there's a route with the same pathname, but with different search params, we can base our optimistic route on that entry. Conceptually, we are simulating what would happen if we did perform a prefetch the requested URL, under the assumption that the server will not redirect or rewrite the request in a different manner than the base route tree. This assumption might not hold, in which case we'll have to recover when we perform the dynamic navigation request. However, this is what would happen if a route were dynamically rewritten/ redirected in between the prefetch and the navigation. So the logic needs to exist to handle this case regardless. The implementation in this PR is a bit of an incremental step; it's not as general as it should be. Notably, it will bail out if the base route tree contains dynamic metadata, because we currently don't store the route tree separately from the metadata. We are also currently special-casing prefetch entries with an empty search string. To take advantage of the optimistic prefetch behavior, there must be a prefetch entry for the target URL with no search params, e.g. to navigate to a page at `/target-page?search=foobar`, you must first prefetch `/target-page` (no search string). This is a somewhat arbitrary limitation chosen as a concession to implementation complexity; the empty search string is only used because it's the one that's most likely to already be cached. We will generalize this later to match any search string. I've added some TODO comments to describe the work necessary to enable this mechanism in more cases. Co-authored-by:Zack Tanner <1939140+ztanner@users.noreply.github.com>
-
Tobias Koppers authored
### What? Avoid mixing rayon and tokio. Only use tokio. Implemented parallel for_each and map on top of tokio. Closes PACK-5158
-
Joseph authored
Closes: https://linear.app/vercel/issue/DOC-4949/clarification-redirecting-in-server-actions-to-self, https://linear.app/vercel/issue/DOC-4973/global-error-and-global-not-found-in-prod-checklist Additionally addresses community confusion and feedback around Server Functions initial client side sequential processing.
-
Sebastian "Sebbie" Silbermann authored
`allReady` is available in all supported React versions so we can remove the conditional check. The helper type can be replaced with the actual type from React.
-
Sebastian "Sebbie" Silbermann authored
Our shadow root was always defined but each callsite guarded against the portal and therefore the shadow root not being defined. This caution also required authoring cascading updates. All of this is not required. We just expose the ShadowRoot in context so that everybody can use it directly.
-
Niklas Mischkulnig authored
We were (unnecessarily) calling `is_self_async()` even for the traced externals (the directly referenced ones, not transitively). This created a bottleneck during the global information computation: <img width="2560" height="1315" alt="Bildschirmfoto 2025-08-13 um 09 50 19" src="https://github.com/user-attachments/assets/4f5d1fa6-3d65-40b2-875e-8a4a579b234b" /> `compute_async_module_info_single` calls `is_self_async` for every single module, regardless of whether the computed value is actually used or not (the traced modules have `ChunkingType::Traced`, so they'd never cause any importers to be async anyway). So manually optimize this case by overriding `is_self_async` for traced externals. This defers the parsing to emitting which is much more parallel: <img width="2560" height="1315" alt="Bildschirmfoto 2025-08-13 um 09 51 23" src="https://github.com/user-attachments/assets/820c7157-7fe0-4253-b02f-1e0d2a8c7e7d" />
-
Luke Sandberg authored
Address a crash found at head when testing caching while switching back and forth from `dev` and `build`. ``` thread '<unnamed>' panicked at turbopack/crates/turbo-persistence/src/db.rs:798:17: attempt to subtract with overflow stack backtrace: 0: __rustc::rust_begin_unwind 1: core::panicking::panic_fmt 2: core::panicking::panic_const::panic_const_sub_overflow 3: <core::iter::adapters::map::Map<core::slice::iter::Iter<alloc::vec::Vec<<turbo_persistence::db::TurboPersistence>::compact_internal::SstWithRange>>, <turbo_persistence::db::TurboPersistence>::compact_internal::{closure#2}> as core::iter::traits::iterator::Iterator>::fold::<(), core::iter::traits::iterator::Iterator::for_each::call<alloc::vec::Vec<smallvec::SmallVec<[usize; 1]>>, <alloc::vec::Vec<alloc::vec::Vec<smallvec::SmallVec<[usize; 1]>>>>::extend_trusted<core::iter::adapters::map::Map<core::slice::iter::Iter<alloc::vec::Vec<<turbo_persistence::db::TurboPersistence>::compact_internal::SstWithRange>>, <turbo_persistence::db::TurboPersistence>::compact_internal::{closure#2}>>::{closure#0}>::{closure#0}> 4: <alloc::vec::Vec<alloc::vec::Vec<smallvec::SmallVec<[usize; 1]>>> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<alloc::vec::Vec<smallvec::SmallVec<[usize; 1]>>, core::iter::adapters::map::Map<core::slice::iter::Iter<alloc::vec::Vec<<turbo_persistence::db::TurboPersistence>::compact_internal::SstWithRange>>, <turbo_persistence::db::TurboPersistence>::compact_internal::{closure#2}>>>::from_iter 5: <turbo_persistence::db::TurboPersistence>::compact ``` Scenario: * build turbopack and next * cd bench/module-cost * enable persistent caching * pnpm i * pnpm dev-turbopack * load localhost:3000 and click all the buttons * pnpm build-turbopack * pnpm dev-turbopack * load localhost:3000 and see the crash ## What? The `get_merge_segments` function and its caller had a different idea about what `max_merge_segment_count` means. Unify how this is accounted to avoid underflow. -
nextjs-bot authored
-
nextjs-bot authored
[diff facebook/react@1dc3bdea...f1222f76](https://github.com/facebook/react/compare/1dc3bdea...f1222f76) <details> <summary>React upstream changes</summary> - https://github.com/facebook/react/pull/34183 - https://github.com/facebook/react/pull/34192 - https://github.com/facebook/react/pull/34186 - https://github.com/facebook/react/pull/34187 </details>
-