This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
# Releases
## @vercel/build-utils@7.2.4
### Patch Changes
- Select Node.js version based on what's available in build-container ([#10822](https://github.com/vercel/vercel/pull/10822))
## vercel@32.5.4
### Patch Changes
- Updated dependencies \[[`65dec5b7e`](65dec5b7e7)]:
- @vercel/build-utils@7.2.4
- @vercel/node@3.0.10
- @vercel/static-build@2.0.11
## @vercel/client@13.0.8
### Patch Changes
- Updated dependencies \[[`65dec5b7e`](65dec5b7e7)]:
- @vercel/build-utils@7.2.4
## @vercel/gatsby-plugin-vercel-builder@2.0.10
### Patch Changes
- Updated dependencies \[[`65dec5b7e`](65dec5b7e7)]:
- @vercel/build-utils@7.2.4
## @vercel/node@3.0.10
### Patch Changes
- Updated dependencies \[[`65dec5b7e`](65dec5b7e7)]:
- @vercel/build-utils@7.2.4
## @vercel/static-build@2.0.11
### Patch Changes
- Updated dependencies \[]:
- @vercel/gatsby-plugin-vercel-builder@2.0.10
## @vercel-internals/types@1.0.15
### Patch Changes
- Updated dependencies \[[`65dec5b7e`](65dec5b7e7)]:
- @vercel/build-utils@7.2.4
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.
# Releases
## vercel@32.5.3
### Patch Changes
- Handle `TooManyProjects` error in places where projects are created
([#10807](https://github.com/vercel/vercel/pull/10807))
- Updated dependencies
\[[`89c1e0323`](89c1e03233),
[`fd29b966d`](fd29b966d3)]:
- @vercel/node@3.0.9
- @vercel/next@4.0.14
## @vercel/next@4.0.14
### Patch Changes
- Fixed headers for static routes when PPR is enabled
([#10808](https://github.com/vercel/vercel/pull/10808))
## @vercel/node@3.0.9
### Patch Changes
- Replace usage of `fetch` with `undici.request`
([#10767](https://github.com/vercel/vercel/pull/10767))
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This adds some tests to the PPR implementation for Next.js. This also
fixes a bug where the static pages were incorrectly generating a header
that falsly indicated that it postponed.
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.
# Releases
## vercel@32.5.2
### Patch Changes
- Updated dependencies
\[[`c94a082f6`](c94a082f6b)]:
- @vercel/next@4.0.13
## @vercel/next@4.0.13
### Patch Changes
- Added `getRequestHandlerWithMetadata` export
([#10753](https://github.com/vercel/vercel/pull/10753))
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This adds a new `getRequestHandlerWithMetadata` export if enabled and
available to the exported method.
---------
Co-authored-by: Joe Haddad <timer@vercel.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
When using `basePath` with statically generated routes, the builder
currently generates lambdas for the root route that conflict with the
prerender functions generated.
E.g. if we have `basePath: "test"` and a root route at: `app/page.js`,
this is currently the output:
```
test
test.rsc
test/index
test/index.rsc
```
The result is that visiting the deployed app at `/test` renders an
incomplete page. On the other hand visiting `/test/index` outputs the
expected markup.
It seems like the intent is that we want to delete the lambdas that
conflict with the prerender functions. I've updated the lambda name
generation logic when doing the deleting to line up with how the lambda
names are generated initially.
Follow-up to https://github.com/vercel/vercel/pull/10750 this removes the underscore prefetching from all prefetch outputs and instead only applies it to the index route itself as this causes issues with PPR making these outputs prerenders and being able to interpolate the route param values.
There is the edge case of a user returning the literal value `index` from `generateStaticParams` but we can tolerate that more than ppr not working as expected.
Follow-up to https://github.com/vercel/vercel/pull/10734 -- but considers that the static prefetch associated with `/` might be inside of a dir such as `index/index.prefetch.rsc`.
To avoid any future matching conflicts, this PR updates to prefix all static prefetches
`next export` has been deprecated on the latest Next.js canary so these
tests will no longer pass.
This changes it to use `output: export` from `next.config.js` instead.
---------
Co-authored-by: JJ Kasper <jj@jjsweb.site>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
# Releases
## vercel@32.5.0
### Minor Changes
- Indicates whether @vercel/speed-insights or @vercel/analytics are used ([#10623](https://github.com/vercel/vercel/pull/10623))
- [cli] update env var validation rule to allow name start with underscore ([#10697](https://github.com/vercel/vercel/pull/10697))
### Patch Changes
- Updated dependencies \[[`da300030c`](da300030c9), [`de84743e1`](de84743e10), [`913608de4`](913608de4d), [`7fa08088e`](7fa08088ea)]:
- @vercel/next@4.0.11
- @vercel/python@4.1.0
- @vercel/remix-builder@2.0.10
- @vercel/redwood@2.0.5
- @vercel/static-build@2.0.9
## @vercel/python@4.1.0
### Minor Changes
- Add support for pip3.10 and pip3.11 ([#10648](https://github.com/vercel/vercel/pull/10648))
## @vercel/routing-utils@3.1.0
### Minor Changes
- Adds support for statusCode property on rewrites ([#10495](https://github.com/vercel/vercel/pull/10495))
## @vercel/client@13.0.6
### Patch Changes
- Updated dependencies \[[`9e9fac019`](9e9fac0191)]:
- @vercel/routing-utils@3.1.0
## @vercel/fs-detectors@5.1.2
### Patch Changes
- Updated dependencies \[[`9e9fac019`](9e9fac0191)]:
- @vercel/routing-utils@3.1.0
## @vercel/gatsby-plugin-vercel-builder@2.0.8
### Patch Changes
- Updated dependencies \[[`9e9fac019`](9e9fac0191)]:
- @vercel/routing-utils@3.1.0
## @vercel/next@4.0.11
### Patch Changes
- fix `build` in appDir on Windows ([#10708](https://github.com/vercel/vercel/pull/10708))
- Fix RSC prefetch for index route with catch-all ([#10734](https://github.com/vercel/vercel/pull/10734))
## @vercel/redwood@2.0.5
### Patch Changes
- Updated dependencies \[[`9e9fac019`](9e9fac0191)]:
- @vercel/routing-utils@3.1.0
## @vercel/remix-builder@2.0.10
### Patch Changes
- Update `@remix-run/dev` fork to v2.1.0 ([#10732](https://github.com/vercel/vercel/pull/10732))
## @vercel/static-build@2.0.9
### Patch Changes
- Updated dependencies \[]:
- @vercel/gatsby-plugin-vercel-builder@2.0.8
## @vercel-internals/types@1.0.13
### Patch Changes
- Updated dependencies \[[`9e9fac019`](9e9fac0191)]:
- @vercel/routing-utils@3.1.0
This adds a new `pnpm type-check` that leverages `turbo` to validate the TypeScript code. This can be run at the top-level or for an individual package.
The `test-lint` workflow will run it after linting and doing the prettier check.
As apart of this effort, each package's `tsconfig.json` has been simplified. There's a new top-level `tsconfig.base.json` file that extends the Vercel Style Guide for TypeScript. Each package's `tsconfig.json` has been audited and previously suppressed rules that no longer apply have been removed. The result is each package's `tsconfig.json` is greatly simplified and we can control common settings in the base config while keeping the flexibility of package-level overrides.
Lastly, in `package/cli`, `pnpm build` calls `scripts/build.mjs` which calls `scripts/compile-templates.mjs`. The `compile-templates.mjs` file was generating invalid TypeScript code. I've fixed it and now it's happier than ever.
Note: In order to run `pnpm type-check`, you must first `pnpm build` because we need the `.d.ts` definition files.
This reverts commit e9026c7a69.
This was causing some builds using Turbo + Next.js to fail with:
```
...writing to cache...
--
17:02:42.820 | Traced Next.js server files in: 169.874ms
17:02:42.871 | Error: Config file was not found at "/vercel/output/config.json"
17:02:42.871 | at f3 (/var/task/sandbox.js:239:2647)
17:02:42.872 | at async TCe (/var/task/sandbox.js:245:4681)
17:02:42.872 | at async WBt (/var/task/sandbox.js:261:1990)
17:02:42.872 | at async zBt (/var/task/sandbox.js:261:1791)
```
INC-442
There was a bug that we caught in the bundled server when using the instrumentation hook that we fixed in https://github.com/vercel/next.js/pull/56318 . This PR bumps the version that we check so that we don't use it if the Next version is not up to date.
While investigating build times noticed that our lambda creation times were increasing linearly with the number of pages which is unexpected since there are mostly shared dependencies. After further investigation it seems we were falling back to our legacy manual `nodeFileTrace` calls in the builder when we shouldn't have been.
Also noticed we were still doing the un-necessary reading/calculating for uncompressed lambda sizes which is as discussed previously isn't required and the only limit we need to keep enforcing is the uncompressed size which is a lot less expensive to compute.
As a further optimization this adds proper usage of our lstat cache/sema where it wasn't previously and proper parallelizing where applicable.
These changes reduce tracing/lambda creation times by 3-5x in larger applications and can fix edge cases where we weren't leveraging our more accurate traces from the build.
Before:
```sh
Traced Next.js server files in: 444.05ms
Created all serverless functions in: 1:36.311 (m:ss.mmm)
Collected static files (public/, static/, .next/static): 241.47ms
```
After:
```sh
Traced Next.js server files in: 10.4ms
Created all serverless functions in: 43.684s
Collected static files (public/, static/, .next/static): 250.828ms
```
Fixes a issue when a Next.js app uses app router + edge runtime + instrumentation hook deployed out on Vercel. The issue is that the code to register the instrumentation hook in Next.js expects `_ENTRIES` to be defined on `globalThis`.
```ts
async function registerInstrumentation() {
console.log("'_ENTRIES' in globalThis:", '_ENTRIES' in globalThis)
console.log(
'_ENTRIES.middleware_instrumentation:',
Boolean(_ENTRIES.middleware_instrumentation)
)
console.log(
'_ENTRIES.middleware_instrumentation.register:',
Boolean(_ENTRIES.middleware_instrumentation.register)
)
if (
'_ENTRIES' in globalThis &&
_ENTRIES.middleware_instrumentation &&
_ENTRIES.middleware_instrumentation.register
) {
try {
console.log('registering middleware instrumentation...')
await _ENTRIES.middleware_instrumentation.register()
console.log('registered middleware instrumentation!')
} catch (err: any) {
err.message = `An error occurred while loading instrumentation hook: ${err.message}`
console.error(err)
throw err
}
}
}
```
produced the following output,

This PR fixes this by changing `let _ENTRIES = {}'` to `globalThis._ENTRIES = {};`

This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.
# Releases
## vercel@32.3.1
### Patch Changes
- Use "esbuild" to build CLI
([#10555](https://github.com/vercel/vercel/pull/10555))
- Updated dependencies
\[[`9f63ca60a`](9f63ca60ad),
[`e3f9faf51`](e3f9faf513)]:
- @vercel/next@4.0.8
- @vercel/remix-builder@2.0.8
## @vercel/next@4.0.8
### Patch Changes
- Fix edge case for setting `__NEXT_PRIVATE_PREBUNDLED_REACT`
([#10568](https://github.com/vercel/vercel/pull/10568))
## @vercel/remix-builder@2.0.8
### Patch Changes
- Update `@remix-run/dev` fork to v2.0.1
([#10566](https://github.com/vercel/vercel/pull/10566))
Updating `nft` to fix a bug. We're a couple version behind. Here's all cumulative changes:
- 0.24.1
- resolve cjs deps as cjs instead of esm
- 0.24.0
- drop node@14
- 0.23.1
- use builtinModules from module
- 0.23.0
- resolve: export resolve() function
- 0.22.6
- Make caching work correctly in async context
For feature flags, we use the string `1` for enabled and the string `0` for disabled.
So we need to check the value of the env var, not the presence of the env var.
This PR adds an environment variable that should allow us to test the bundled version for Next.js on Vercel, see https://github.com/vercel/next.js/pull/52997 for reference.
The changes include:
- a new environment variable `VERCEL_NEXT_BUNDLED_SERVER`
- some logic changes that will put app route handlers into their own lambda groups
- extra logic to require early the rendering runtimes (see PR above for details)
This ensures that the `.prefetch.rsc` requests respond with the correct `content-type` since this is used by Next.js to determine if a request is valid or not (and in the case it's invalid, an mpa navigation will occur)
Fixes: https://github.com/vercel/next.js/issues/54934
The following error occurs during build when `basePath` is present in conjunction with `fallback: false` in `getStaticPaths`:
> Error: ENOENT: no such file or directory, open '/vercel/path0/.next/server/pages/404.html'
`localePrefixed404` was incorrectly being set to `false` because it was looking for `/<basePath>/<locale>/404.html` (when it's actually `/<locale>/404.html`)
This meant that inside `onPrerenderRoute`, `htmlFsRef` was pointing to `/404.html` rather than `/en/404.html`.
- Removes some of the hacks from #10388 that were attempting to resolve an issue with RSC prefetches to `pages` routes in favor of adding rsc rewrites for all dynamic paths, and letting it fall through to a 404 if there's no match
- Fixes an issue where RSC requests were matching the wrong path (filesystem rather than RSC variant) introduced in above mentioned change
- Closes https://github.com/vercel/next.js/issues/54698
Addresses ReDoS vulnerability: https://security.snyk.io/vuln/SNYK-JS-SEMVER-3247795
Uses the latest unaffected versions in the respective major versions, to prevent having to deal with any other breaking changes.