language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
vercel
next.js
9bff48b9d5998455c9c038d7f5834a58bb9f429f.json
Adopt react 18 rc2 (#35161) * Adopt react 18 rc2 * execute shouldUseReactRoot only once * update test Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
test/production/react-18-streaming-ssr/index.test.ts
@@ -24,8 +24,8 @@ describe('react 18 streaming SSR in minimal mode', () => { }, }, dependencies: { - react: '18.0.0-rc.1', - 'react-dom': '18.0.0-rc.1', + react: '18.0.0-rc.2', + 'react-dom': '18.0.0-rc.2', }, }) }) @@ -60,8 +60,8 @@ describe('react 18 s...
true
Other
vercel
next.js
9bff48b9d5998455c9c038d7f5834a58bb9f429f.json
Adopt react 18 rc2 (#35161) * Adopt react 18 rc2 * execute shouldUseReactRoot only once * update test Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
yarn.lock
@@ -17778,20 +17778,20 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.7, rc@^1.2.8: minimist "^1.2.0" strip-json-comments "~2.0.1" -"react-18@npm:react@18.0.0-rc.1": - version "18.0.0-rc.1" - resolved "https://registry.yarnpkg.com/react/-/react-18.0.0-rc.1.tgz#fbaef1cbf8b1eddb36a869ee1ea723044aa670c2" - integrity sha5...
true
Other
vercel
next.js
3dfb66fc19b68885599242251a2d594dc5222e89.json
Fix missing parenthesis for link in docs (#35090) ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint`
docs/testing.md
@@ -232,7 +232,7 @@ Run `npm run build` and `npm run start`, then run `npm run test:e2e` in another ### Running Playwright on Continuous Integration (CI) -Playwright will by default run your tests in the [headless mode]https://playwright.dev/docs/ci#running-headed). To install all the Playwright dependencies, run ...
false
Other
vercel
next.js
946f465a6e4aba2a2aeee8dd33666e64e9075449.json
fix(examples/with-docker): add npm comment for yarn build (#35040) There was an `npm` equivalent for `yarn install` (`npm ci`) but not one for `yarn build`. I've added `npm run build` as a commented out option. ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint`
examples/with-docker/Dockerfile
@@ -23,6 +23,9 @@ COPY . . RUN yarn build +# If using npm comment out above and use below instead +# RUN npm run build + # Production image, copy all the files and run next FROM node:16-alpine AS runner WORKDIR /app
false
Other
vercel
next.js
5fb6980c4435d05a6d3d31ae4a57aaf4940f0abd.json
Update supertokens demo app (#35007) New version of supertokens-auth-react. Co-authored-by: Bhumil Sarvaiya <21988812+bhumilsarvaiya@users.noreply.github.com> Co-authored-by: Joel Coutinho <6310783+jscyo@users.noreply.github.com>
examples/with-supertokens/package.json
@@ -9,7 +9,7 @@ "next": "latest", "react": "^17.0.1", "react-dom": "^17.0.1", - "supertokens-auth-react": "^0.18.0", + "supertokens-auth-react": "^0.19.0", "supertokens-node": "^9.0.0" } }
false
Other
vercel
next.js
81c50f4a87a3dd1ef03f2d2c0bbc00447812268e.json
Handle de-duping revalidations in minimal mode (#34935) * Handle de-duping revalidations in minimal mode * fix type * remove header check * update other tests * update test
packages/next/server/base-server.ts
@@ -373,7 +373,10 @@ export default abstract class Server { } }, }) - this.responseCache = new ResponseCache(this.incrementalCache) + this.responseCache = new ResponseCache( + this.incrementalCache, + this.minimalMode + ) } public logError(err: Error): void { @@ -1274,7 +...
true
Other
vercel
next.js
81c50f4a87a3dd1ef03f2d2c0bbc00447812268e.json
Handle de-duping revalidations in minimal mode (#34935) * Handle de-duping revalidations in minimal mode * fix type * remove header check * update other tests * update test
packages/next/server/next-server.ts
@@ -120,7 +120,8 @@ export default class NextNodeServer extends BaseServer { new ImageOptimizerCache({ distDir: this.distDir, nextConfig: this.nextConfig, - }) + }), + this.minimalMode ) }
true
Other
vercel
next.js
81c50f4a87a3dd1ef03f2d2c0bbc00447812268e.json
Handle de-duping revalidations in minimal mode (#34935) * Handle de-duping revalidations in minimal mode * fix type * remove header check * update other tests * update test
packages/next/server/response-cache.ts
@@ -81,16 +81,25 @@ interface IncrementalCache { export default class ResponseCache { incrementalCache: IncrementalCache pendingResponses: Map<string, Promise<ResponseCacheEntry | null>> + previousCacheItem?: { + key: string + entry: ResponseCacheEntry | null + expiresAt: number + } + minimalMode?: b...
true
Other
vercel
next.js
81c50f4a87a3dd1ef03f2d2c0bbc00447812268e.json
Handle de-duping revalidations in minimal mode (#34935) * Handle de-duping revalidations in minimal mode * fix type * remove header check * update other tests * update test
test/e2e/prerender.test.ts
@@ -164,6 +164,11 @@ describe('Prerender', () => { initialRevalidateSeconds: 1, srcRoute: '/blocking-fallback-some/[slug]', }, + '/blocking-fallback/test-errors-1': { + dataRoute: `/_next/data/${next.buildId}/blocking-fallback/test-errors-1.json`, + initialRevalidateSeconds: 1, + sr...
true
Other
vercel
next.js
81c50f4a87a3dd1ef03f2d2c0bbc00447812268e.json
Handle de-duping revalidations in minimal mode (#34935) * Handle de-duping revalidations in minimal mode * fix type * remove header check * update other tests * update test
test/integration/required-server-files-ssr-404/test/index.test.js
@@ -4,7 +4,7 @@ import http from 'http' import fs from 'fs-extra' import { join } from 'path' import cheerio from 'cheerio' -import { nextServer } from 'next-test-utils' +import { nextServer, waitFor } from 'next-test-utils' import { fetchViaHTTP, findPort, @@ -140,6 +140,7 @@ describe('Required Server Files'...
true
Other
vercel
next.js
81c50f4a87a3dd1ef03f2d2c0bbc00447812268e.json
Handle de-duping revalidations in minimal mode (#34935) * Handle de-duping revalidations in minimal mode * fix type * remove header check * update other tests * update test
test/production/required-server-files-i18n.test.ts
@@ -11,6 +11,7 @@ import { initNextServerScript, killApp, renderViaHTTP, + waitFor, } from 'next-test-utils' describe('should set-up next', () => { @@ -133,6 +134,7 @@ describe('should set-up next', () => { 's-maxage=1, stale-while-revalidate' ) + await waitFor(2000) await next.patch...
true
Other
vercel
next.js
81c50f4a87a3dd1ef03f2d2c0bbc00447812268e.json
Handle de-duping revalidations in minimal mode (#34935) * Handle de-duping revalidations in minimal mode * fix type * remove header check * update other tests * update test
test/production/required-server-files.test.ts
@@ -11,6 +11,7 @@ import { initNextServerScript, killApp, renderViaHTTP, + waitFor, } from 'next-test-utils' describe('should set-up next', () => { @@ -155,7 +156,30 @@ describe('should set-up next', () => { expect(typeof requiredFilesManifest.appDir).toBe('string') }) + it('should de-dupe HTML...
true
Other
vercel
next.js
81c50f4a87a3dd1ef03f2d2c0bbc00447812268e.json
Handle de-duping revalidations in minimal mode (#34935) * Handle de-duping revalidations in minimal mode * fix type * remove header check * update other tests * update test
test/production/required-server-files/pages/gsp.js
@@ -1,11 +1,14 @@ import fs from 'fs' import path from 'path' +let gspCalls = 0 + export async function getStaticProps() { const data = await fs.promises.readFile( path.join(process.cwd(), 'data.txt'), 'utf8' ) + gspCalls += 1 if (data.trim() === 'hide') { return { @@ -18,6 +21,7 @@ expo...
true
Other
vercel
next.js
e3d0d645afb6e017dd7f745edd359efb7facf4e2.json
Adopt react 18 rc1 (#34972) ### Changes * Remove top-level suspense boundary * Pipe stream resolved from returned promimse of `renderToReadableStream` * Remove jsx-runtime alias hack ### Test Changes Since top level suspense boundary is removed, now content are filled in 1st SSR
package.json
@@ -144,9 +144,9 @@ "pretty-ms": "7.0.0", "random-seed": "0.3.0", "react": "17.0.2", - "react-18": "npm:react@18.0.0-rc.0", + "react-18": "npm:react@18.0.0-rc.1", "react-dom": "17.0.2", - "react-dom-18": "npm:react-dom@18.0.0-rc.0", + "react-dom-18": "npm:react-dom@18.0.0-rc.1", "re...
true
Other
vercel
next.js
e3d0d645afb6e017dd7f745edd359efb7facf4e2.json
Adopt react 18 rc1 (#34972) ### Changes * Remove top-level suspense boundary * Pipe stream resolved from returned promimse of `renderToReadableStream` * Remove jsx-runtime alias hack ### Test Changes Since top level suspense boundary is removed, now content are filled in 1st SSR
packages/next/build/webpack/loaders/next-flight-server-loader.ts
@@ -69,11 +69,16 @@ async function parseImportsInfo({ transformedSource += JSON.stringify(`${importSource}?__sc_client__`) imports += `require(${JSON.stringify(importSource)})\n` } else { + // FIXME + // case: 'react' + // Avoid module resolution err...
true
Other
vercel
next.js
e3d0d645afb6e017dd7f745edd359efb7facf4e2.json
Adopt react 18 rc1 (#34972) ### Changes * Remove top-level suspense boundary * Pipe stream resolved from returned promimse of `renderToReadableStream` * Remove jsx-runtime alias hack ### Test Changes Since top level suspense boundary is removed, now content are filled in 1st SSR
packages/next/client/index.tsx
@@ -547,9 +547,10 @@ function renderReactElement( const reactEl = fn(shouldHydrate ? markHydrateComplete : markRenderComplete) if (process.env.__NEXT_REACT_ROOT) { + const ReactDOMClient = require('react-dom/client') if (!reactRoot) { // Unlike with createRoot, you don't need a separate root.rend...
true
Other
vercel
next.js
e3d0d645afb6e017dd7f745edd359efb7facf4e2.json
Adopt react 18 rc1 (#34972) ### Changes * Remove top-level suspense boundary * Pipe stream resolved from returned promimse of `renderToReadableStream` * Remove jsx-runtime alias hack ### Test Changes Since top level suspense boundary is removed, now content are filled in 1st SSR
packages/next/server/render.tsx
@@ -395,11 +395,7 @@ function createServerComponentRenderer( } const Component = (props: any) => { - return ( - <React.Suspense fallback={null}> - <ServerComponentWrapper {...props} /> - </React.Suspense> - ) + return <ServerComponentWrapper {...props} /> } // Although it's not...
true
Other
vercel
next.js
e3d0d645afb6e017dd7f745edd359efb7facf4e2.json
Adopt react 18 rc1 (#34972) ### Changes * Remove top-level suspense boundary * Pipe stream resolved from returned promimse of `renderToReadableStream` * Remove jsx-runtime alias hack ### Test Changes Since top level suspense boundary is removed, now content are filled in 1st SSR
test/integration/react-18/app/pages/suspense/unwrapped.js
@@ -1,19 +0,0 @@ -import React, { Suspense } from 'react' -import dynamic from 'next/dynamic' - -// flag for testing -const wrapped = true - -const Hello = dynamic(() => import('../../components/hello'), { - suspense: true, -}) - -export default function Unwrapped() { - if (!wrapped) return <Hello /> - - return ( - ...
true
Other
vercel
next.js
e3d0d645afb6e017dd7f745edd359efb7facf4e2.json
Adopt react 18 rc1 (#34972) ### Changes * Remove top-level suspense boundary * Pipe stream resolved from returned promimse of `renderToReadableStream` * Remove jsx-runtime alias hack ### Test Changes Since top level suspense boundary is removed, now content are filled in 1st SSR
test/integration/react-18/test/index.test.js
@@ -25,7 +25,6 @@ const nodeArgs = ['-r', join(__dirname, 'require-hook.js')] const appDir = join(__dirname, '../app') const nextConfig = new File(join(appDir, 'next.config.js')) const dynamicHello = new File(join(appDir, 'components/dynamic-hello.js')) -const unwrappedPage = new File(join(appDir, 'pages/suspense/un...
true
Other
vercel
next.js
e3d0d645afb6e017dd7f745edd359efb7facf4e2.json
Adopt react 18 rc1 (#34972) ### Changes * Remove top-level suspense boundary * Pipe stream resolved from returned promimse of `renderToReadableStream` * Remove jsx-runtime alias hack ### Test Changes Since top level suspense boundary is removed, now content are filled in 1st SSR
test/integration/react-18/test/with-react-18.js
@@ -1,13 +1,10 @@ module.exports = function withReact18(config) { config.webpack = (webpackConfig) => { const { alias } = webpackConfig.resolve - // FIXME: resolving react/jsx-runtime https://github.com/facebook/react/issues/20235 - alias['react/jsx-dev-runtime'] = 'react/jsx-dev-runtime.js' - alias['...
true
Other
vercel
next.js
e3d0d645afb6e017dd7f745edd359efb7facf4e2.json
Adopt react 18 rc1 (#34972) ### Changes * Remove top-level suspense boundary * Pipe stream resolved from returned promimse of `renderToReadableStream` * Remove jsx-runtime alias hack ### Test Changes Since top level suspense boundary is removed, now content are filled in 1st SSR
test/integration/react-streaming-and-server-components/app/next.config.js
@@ -1,7 +1,6 @@ const withReact18 = require('../../react-18/test/with-react-18') module.exports = withReact18({ - trailingSlash: true, reactStrictMode: true, onDemandEntries: { maxInactiveAge: 1000 * 60 * 60,
true
Other
vercel
next.js
e3d0d645afb6e017dd7f745edd359efb7facf4e2.json
Adopt react 18 rc1 (#34972) ### Changes * Remove top-level suspense boundary * Pipe stream resolved from returned promimse of `renderToReadableStream` * Remove jsx-runtime alias hack ### Test Changes Since top level suspense boundary is removed, now content are filled in 1st SSR
test/integration/react-streaming-and-server-components/test/rsc.js
@@ -78,10 +78,7 @@ export default function (context, { runtime, env }) { it('should support next/link in server components', async () => { const linkHTML = await renderViaHTTP(context.appPort, '/next-api/link') - const linkText = getNodeBySelector( - linkHTML, - 'div[hidden] > a[href="/"]' - )...
true
Other
vercel
next.js
e3d0d645afb6e017dd7f745edd359efb7facf4e2.json
Adopt react 18 rc1 (#34972) ### Changes * Remove top-level suspense boundary * Pipe stream resolved from returned promimse of `renderToReadableStream` * Remove jsx-runtime alias hack ### Test Changes Since top level suspense boundary is removed, now content are filled in 1st SSR
test/production/react-18-streaming-ssr/index.test.ts
@@ -24,8 +24,8 @@ describe('react 18 streaming SSR in minimal mode', () => { }, }, dependencies: { - react: '18.0.0-rc.0', - 'react-dom': '18.0.0-rc.0', + react: '18.0.0-rc.1', + 'react-dom': '18.0.0-rc.1', }, }) }) @@ -47,8 +47,8 @@ describe('react 18 s...
true
Other
vercel
next.js
e3d0d645afb6e017dd7f745edd359efb7facf4e2.json
Adopt react 18 rc1 (#34972) ### Changes * Remove top-level suspense boundary * Pipe stream resolved from returned promimse of `renderToReadableStream` * Remove jsx-runtime alias hack ### Test Changes Since top level suspense boundary is removed, now content are filled in 1st SSR
yarn.lock
@@ -17527,22 +17527,20 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.7, rc@^1.2.8: minimist "^1.2.0" strip-json-comments "~2.0.1" -"react-18@npm:react@18.0.0-rc.0": - version "18.0.0-rc.0" - resolved "https://registry.yarnpkg.com/react/-/react-18.0.0-rc.0.tgz#60bfcf1edd0b35fbeeeca852515c6cc2ce06a6eb" - integrity sha5...
true
Other
vercel
next.js
d9d494adaf2114f9519b8ea816126ed4787deffb.json
Provide page runtime parsing utils (#34922) * parse runtime config * add test * fix typing * fix lint warning * change branch purging condition * dont fallback to global runtime
packages/next/build/entries.ts
@@ -1,3 +1,4 @@ +import fs from 'fs' import chalk from 'next/dist/compiled/chalk' import { posix, join } from 'path' import { stringify } from 'querystring' @@ -12,6 +13,7 @@ import { ClientPagesLoaderOptions } from './webpack/loaders/next-client-pages-lo import { ServerlessLoaderQuery } from './webpack/loaders/nex...
true
Other
vercel
next.js
d9d494adaf2114f9519b8ea816126ed4787deffb.json
Provide page runtime parsing utils (#34922) * parse runtime config * add test * fix typing * fix lint warning * change branch purging condition * dont fallback to global runtime
packages/next/build/swc/index.d.ts
@@ -0,0 +1,7 @@ +export function isWasm(): Promise<boolean> +export function transform(src: string, options?: any): Promise<any> +export function transformSync(src: string, options?: any): any +export function minify(src: string, options: any): Promise<string> +export function minifySync(src: string, options: any): str...
true
Other
vercel
next.js
d9d494adaf2114f9519b8ea816126ed4787deffb.json
Provide page runtime parsing utils (#34922) * parse runtime config * add test * fix typing * fix lint warning * change branch purging condition * dont fallback to global runtime
packages/next/build/swc/index.js
@@ -1,6 +1,7 @@ import { platform, arch } from 'os' import { platformArchTriples } from 'next/dist/compiled/@napi-rs/triples' import * as Log from '../output/log' +import { getParserOptions } from './options' const ArchName = arch() const PlatformName = platform() @@ -229,5 +230,6 @@ export async function bundle...
true
Other
vercel
next.js
d9d494adaf2114f9519b8ea816126ed4787deffb.json
Provide page runtime parsing utils (#34922) * parse runtime config * add test * fix typing * fix lint warning * change branch purging condition * dont fallback to global runtime
packages/next/build/swc/options.d.ts
@@ -0,0 +1,7 @@ +export function getParserOptions(options: { + filename: string + jsConfig?: any + [key: string]: any +}): any +export function getJestSWCOptions(...args: any[]): any +export function getLoaderSWCOptions(...args: any[]): any
true
Other
vercel
next.js
d9d494adaf2114f9519b8ea816126ed4787deffb.json
Provide page runtime parsing utils (#34922) * parse runtime config * add test * fix typing * fix lint warning * change branch purging condition * dont fallback to global runtime
packages/next/build/swc/options.js
@@ -5,7 +5,23 @@ const regeneratorRuntimePath = require.resolve( 'next/dist/compiled/regenerator-runtime' ) -export function getBaseSWCOptions({ +export function getParserOptions({ filename, jsConfig, ...rest }) { + const isTSFile = filename.endsWith('.ts') + const isTypeScript = isTSFile || filename.endsWith('...
true
Other
vercel
next.js
d9d494adaf2114f9519b8ea816126ed4787deffb.json
Provide page runtime parsing utils (#34922) * parse runtime config * add test * fix typing * fix lint warning * change branch purging condition * dont fallback to global runtime
packages/next/build/webpack/loaders/next-flight-client-loader.ts
@@ -5,11 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -// TODO: add ts support for next-swc api -// @ts-ignore import { parse } from '../../swc' -// @ts-ignore -import { getBaseSWCOptions } from '../../swc/options' function addExportNames(names: string[], node: any) { switch (node.t...
true
Other
vercel
next.js
d9d494adaf2114f9519b8ea816126ed4787deffb.json
Provide page runtime parsing utils (#34922) * parse runtime config * add test * fix typing * fix lint warning * change branch purging condition * dont fallback to global runtime
packages/next/build/webpack/loaders/next-flight-server-loader.ts
@@ -1,8 +1,4 @@ -// TODO: add ts support for next-swc api -// @ts-ignore import { parse } from '../../swc' -// @ts-ignore -import { getBaseSWCOptions } from '../../swc/options' import { getRawPageExtensions } from '../../utils' const imageExtensions = ['jpg', 'jpeg', 'png', 'webp', 'avif'] @@ -46,11 +42,7 @@ async...
true
Other
vercel
next.js
d9d494adaf2114f9519b8ea816126ed4787deffb.json
Provide page runtime parsing utils (#34922) * parse runtime config * add test * fix typing * fix lint warning * change branch purging condition * dont fallback to global runtime
test/integration/react-18/app/pages/index.js
@@ -19,3 +19,7 @@ export default function Index() { </div> ) } + +export const config = { + runtime: 'edge', +}
true
Other
vercel
next.js
d9d494adaf2114f9519b8ea816126ed4787deffb.json
Provide page runtime parsing utils (#34922) * parse runtime config * add test * fix typing * fix lint warning * change branch purging condition * dont fallback to global runtime
test/unit/fixtures/page-runtime/edge.js
@@ -0,0 +1,8 @@ +export default function Edge() { + return 'edge' +} + +export const config = { + runtime: 'edge', + amp: false, +}
true
Other
vercel
next.js
d9d494adaf2114f9519b8ea816126ed4787deffb.json
Provide page runtime parsing utils (#34922) * parse runtime config * add test * fix typing * fix lint warning * change branch purging condition * dont fallback to global runtime
test/unit/fixtures/page-runtime/nodejs.js
@@ -0,0 +1,8 @@ +export default function Nodejs() { + return 'nodejs' +} + +export const config = { + amp: false, + runtime: 'nodejs', +}
true
Other
vercel
next.js
d9d494adaf2114f9519b8ea816126ed4787deffb.json
Provide page runtime parsing utils (#34922) * parse runtime config * add test * fix typing * fix lint warning * change branch purging condition * dont fallback to global runtime
test/unit/fixtures/page-runtime/static.js
@@ -0,0 +1,3 @@ +export default function Static() { + return 'static' +}
true
Other
vercel
next.js
d9d494adaf2114f9519b8ea816126ed4787deffb.json
Provide page runtime parsing utils (#34922) * parse runtime config * add test * fix typing * fix lint warning * change branch purging condition * dont fallback to global runtime
test/unit/parse-page-runtime.test.ts
@@ -0,0 +1,27 @@ +import { getPageRuntime } from 'next/dist/build/entries' +import { join } from 'path' + +const fixtureDir = join(__dirname, 'fixtures') + +describe('parse page runtime config', () => { + it('should parse nodejs runtime correctly', async () => { + const runtime = await getPageRuntime( + join(f...
true
Other
vercel
next.js
b6b5250c4620b6f76bd82029cb89b4cac27fe486.json
Ensure non-matching API routes can be rewritten (#33966) This ensures non-matching API routes can be rewritten with i18n configured as currently we bail and render the 404 page when a locale prefixed API route is requested. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added ...
packages/next/server/base-server.ts
@@ -560,9 +560,6 @@ export default abstract class Server { if (url.locale?.path.detectedLocale) { req.url = formatUrl(url) addRequestMeta(req, '__nextStrippedLocale', true) - if (url.pathname === '/api' || url.pathname.startsWith('/api/')) { - return this.render404(req, res, par...
true
Other
vercel
next.js
b6b5250c4620b6f76bd82029cb89b4cac27fe486.json
Ensure non-matching API routes can be rewritten (#33966) This ensures non-matching API routes can be rewritten with i18n configured as currently we bail and render the 404 page when a locale prefixed API route is requested. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added ...
packages/next/server/router.ts
@@ -317,8 +317,20 @@ export default class Router { currentPathnameNoBasePath, this.locales ) + const activeBasePath = keepBasePath ? this.basePath : '' + // don't match API routes when they are locale prefixed + // e.g. /api/hello shouldn't match /en/api/hello as a page + ...
true
Other
vercel
next.js
b6b5250c4620b6f76bd82029cb89b4cac27fe486.json
Ensure non-matching API routes can be rewritten (#33966) This ensures non-matching API routes can be rewritten with i18n configured as currently we bail and render the 404 page when a locale prefixed API route is requested. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added ...
test/e2e/i18n-api-support/index.test.ts
@@ -0,0 +1,71 @@ +import { createNext } from 'e2e-utils' +import { fetchViaHTTP } from 'next-test-utils' +import { NextInstance } from 'test/lib/next-modes/base' + +describe('i18n API support', () => { + let next: NextInstance + + beforeAll(async () => { + next = await createNext({ + files: { + 'pages/...
true
Other
vercel
next.js
721dc7bccd0bcdd6f8d6600b0dc30192822a0f3d.json
Add missing closing parenthesis in docs (#34924) A closing parenthesis was missing in the docs about static HTML export.
docs/advanced-features/static-html-export.md
@@ -27,7 +27,7 @@ Update your build script in `package.json` to use `next export`: Running `npm run build` will generate an `out` directory. -`next export` builds an HTML version of your app. During `next build`, [`getStaticProps`](/docs/basic-features/data-fetching/get-static-props.md) and [`getStaticPaths`](/doc...
false
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-agilitycms/components/hero-post.js
@@ -20,7 +20,7 @@ export default function HeroPost({ slug={slug} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28"> <div> <h3 className="m...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-agilitycms/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ title, posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> {title} </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-builder-io/components/hero-post.js
@@ -16,7 +16,7 @@ export default function HeroPost({ <div className="mb-8 md:mb-16"> <CoverImage title={title} slug={slug} url={coverImage} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-x-16...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-builder-io/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-buttercms/components/hero-post.js
@@ -16,7 +16,7 @@ export default function HeroPost({ <div className="mb-8 md:mb-16"> <CoverImage title={title} url={coverImage} slug={slug} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-x-16...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-buttercms/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-contentful/components/hero-post.js
@@ -16,7 +16,7 @@ export default function HeroPost({ <div className="mb-8 md:mb-16"> <CoverImage title={title} slug={slug} url={coverImage.url} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-contentful/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-cosmic/components/hero-post.js
@@ -16,7 +16,7 @@ export default function HeroPost({ <div className="mb-8 md:mb-16"> <CoverImage title={title} url={coverImage.imgix_url} slug={slug} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 m...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-cosmic/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-datocms/components/hero-post.js
@@ -20,7 +20,7 @@ export default function HeroPost({ slug={slug} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28"> <div> <h3 className="m...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-datocms/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-drupal/components/hero-post.js
@@ -18,7 +18,7 @@ export default function HeroPost({ <CoverImage title={title} coverImage={coverImage} slug={slug} /> )} </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 ...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-ghost/components/hero-post.js
@@ -22,7 +22,7 @@ export default function HeroPost({ height={1216} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28"> <div> <h3 className=...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-ghost/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-graphcms/components/hero-post.js
@@ -16,7 +16,7 @@ export default function HeroPost({ <div className="mb-8 md:mb-16"> <CoverImage slug={slug} title={title} url={coverImage.url} /> </div> - <div className="mb-20 md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 md:mb-28"> + <div className="mb-20 md:grid md:grid-cols-2 m...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-kontent/components/hero-post.js
@@ -16,7 +16,7 @@ export default function HeroPost({ <div className="mb-8 md:mb-16"> <CoverImage title={title} src={coverImage} slug={slug} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-x-16...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-kontent/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-prepr/components/hero-post.js
@@ -16,7 +16,7 @@ export default function HeroPost({ <div className="mb-8 md:mb-16"> <CoverImage slug={slug} title={title} url={coverImage} /> </div> - <div className="mb-20 md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 md:mb-28"> + <div className="mb-20 md:grid md:grid-cols-2 md:ga...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-prismic/components/hero-post.js
@@ -21,7 +21,7 @@ export default function HeroPost({ url={coverImage.url} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28"> <div> <h3 cla...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-prismic/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-sanity/components/hero-post.js
@@ -16,7 +16,7 @@ export default function HeroPost({ <div className="mb-8 md:mb-16"> <CoverImage slug={slug} title={title} image={coverImage} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-x-...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-sanity/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-storyblok/components/hero-post.js
@@ -16,7 +16,7 @@ export default function HeroPost({ <div className="mb-8 md:mb-16"> <CoverImage title={title} url={coverImage} slug={slug} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-x-16...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-storyblok/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-strapi/components/hero-post.js
@@ -16,7 +16,7 @@ export default function HeroPost({ <div className="mb-8 md:mb-16"> <CoverImage title={title} url={coverImage.url} slug={slug} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-strapi/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-takeshape/components/hero-post.js
@@ -16,7 +16,7 @@ export default function HeroPost({ <div className="mb-8 md:mb-16"> <CoverImage title={title} coverImage={coverImage} slug={slug} /> </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:g...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-takeshape/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-wordpress/components/hero-post.js
@@ -18,7 +18,7 @@ export default function HeroPost({ <CoverImage title={title} coverImage={coverImage} slug={slug} /> )} </div> - <div className="md:grid md:grid-cols-2 md:col-gap-16 lg:col-gap-8 mb-20 md:mb-28"> + <div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 ...
true
Other
vercel
next.js
6b37d6c39e6752ab21a4417cace73f51a30e513c.json
docs: update CMS examples to use the new tw grid gaps (#34917)
examples/cms-wordpress/components/more-stories.js
@@ -6,7 +6,7 @@ export default function MoreStories({ posts }) { <h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight"> More Stories </h2> - <div className="grid grid-cols-1 md:grid-cols-2 md:col-gap-16 lg:col-gap-32 row-gap-20 md:row-gap-32 mb-32"> + <div c...
true
Other
vercel
next.js
e0631d0ef115db42caf16b0e5c7b16052f85df15.json
Fix links in google-font-display error (#37661)
errors/google-font-display.md
@@ -33,4 +33,5 @@ If you want to specifically display a font using a `block` or `fallback` strateg ### Useful Links -- [Font-display](https://font-display.glitch.me/) +- [Google Fonts API Docs](https://developers.google.com/fonts/docs/css2#use_font-display) +- [CSS `font-display` property](https://www.w3.org/TR/cs...
false
Other
vercel
next.js
6f698405dda99ef791bf3b8ac86020b7997a9e77.json
Update matched path params priority (#37646) This ensures we use the correct dynamic route params favoring params from the URL/matched-path over route-matches. This also ensures we properly cache `_next/data` requests client side when the page is not a `getServerSideProps` page. x-ref: https://github.com/vercel/next...
packages/next/build/webpack/loaders/next-serverless-loader/utils.ts
@@ -351,6 +351,7 @@ export function getUtils({ // on the parsed params, this is used to signal if we need // to parse x-now-route-matches or not const defaultValue = defaultRouteMatches![key] + const isOptional = defaultRouteRegex!.groups[key].optional const isDefaultValue = Array.isA...
true
Other
vercel
next.js
6f698405dda99ef791bf3b8ac86020b7997a9e77.json
Update matched path params priority (#37646) This ensures we use the correct dynamic route params favoring params from the URL/matched-path over route-matches. This also ensures we properly cache `_next/data` requests client side when the page is not a `getServerSideProps` page. x-ref: https://github.com/vercel/next...
packages/next/lib/download-wasm-swc.ts
@@ -107,9 +107,13 @@ export async function downloadWasmSwc( const cacheFiles = await fs.promises.readdir(cacheDirectory) if (cacheFiles.length > MAX_VERSIONS_TO_CACHE) { - cacheFiles.sort() + cacheFiles.sort((a, b) => { + if (a.length < b.length) return -1 + return a.localeCompare(b) + }) -...
true
Other
vercel
next.js
6f698405dda99ef791bf3b8ac86020b7997a9e77.json
Update matched path params priority (#37646) This ensures we use the correct dynamic route params favoring params from the URL/matched-path over route-matches. This also ensures we properly cache `_next/data` requests client side when the page is not a `getServerSideProps` page. x-ref: https://github.com/vercel/next...
packages/next/server/base-server.ts
@@ -457,6 +457,7 @@ export default abstract class Server<ServerOptions extends Options = Options> { if (urlPathname.startsWith(`/_next/data/`)) { parsedUrl.query.__nextDataReq = '1' } + const normalizedUrlPath = this.stripNextDataPath(urlPathname) matchedPath = thi...
true
Other
vercel
next.js
6f698405dda99ef791bf3b8ac86020b7997a9e77.json
Update matched path params priority (#37646) This ensures we use the correct dynamic route params favoring params from the URL/matched-path over route-matches. This also ensures we properly cache `_next/data` requests client side when the page is not a `getServerSideProps` page. x-ref: https://github.com/vercel/next...
packages/next/shared/lib/router/router.ts
@@ -456,6 +456,17 @@ interface FetchDataOutput { text: string } +interface FetchNextDataParams { + dataHref: string + isServerRender: boolean + parseJSON: boolean | undefined + hasMiddleware?: boolean + inflightCache: NextDataCache + persistCache: boolean + isPrefetch: boolean + isBackground?: boolean +} ...
true
Other
vercel
next.js
6f698405dda99ef791bf3b8ac86020b7997a9e77.json
Update matched path params priority (#37646) This ensures we use the correct dynamic route params favoring params from the URL/matched-path over route-matches. This also ensures we properly cache `_next/data` requests client side when the page is not a `getServerSideProps` page. x-ref: https://github.com/vercel/next...
test/e2e/middleware-rewrites/test/index.test.ts
@@ -194,6 +194,31 @@ describe('Middleware Rewrite', () => { expect(await element.text()).toEqual('About Bypassed Page') }) + if (!(global as any).isNextDev) { + it('should cache data requests correctly', async () => { + const browser = await webdriver(next.url, '/') + + await check(a...
true
Other
vercel
next.js
6f698405dda99ef791bf3b8ac86020b7997a9e77.json
Update matched path params priority (#37646) This ensures we use the correct dynamic route params favoring params from the URL/matched-path over route-matches. This also ensures we properly cache `_next/data` requests client side when the page is not a `getServerSideProps` page. x-ref: https://github.com/vercel/next...
test/integration/middleware-prefetch/tests/index.test.js
@@ -71,7 +71,11 @@ describe('Middleware Production Prefetch', () => { const mapped = hrefs.map((href) => new URL(href).pathname.replace(/^\/_next\/data\/[^/]+/, '') ) - assert.deepEqual(mapped, ['/ssg-page.json']) + assert.deepEqual(mapped, [ + '/made-up.json', + '/ssg-pag...
true
Other
vercel
next.js
6f698405dda99ef791bf3b8ac86020b7997a9e77.json
Update matched path params priority (#37646) This ensures we use the correct dynamic route params favoring params from the URL/matched-path over route-matches. This also ensures we properly cache `_next/data` requests client side when the page is not a `getServerSideProps` page. x-ref: https://github.com/vercel/next...
test/integration/required-server-files-ssr-404/test/index.test.js
@@ -533,7 +533,7 @@ describe('Required Server Files', () => { }) it('should match the root dynamic page correctly', async () => { - const res = await fetchViaHTTP(appPort, '/index', undefined, { + const res = await fetchViaHTTP(appPort, '/slug-1', undefined, { headers: { 'x-matched-path': ...
true
Other
vercel
next.js
6f698405dda99ef791bf3b8ac86020b7997a9e77.json
Update matched path params priority (#37646) This ensures we use the correct dynamic route params favoring params from the URL/matched-path over route-matches. This also ensures we properly cache `_next/data` requests client side when the page is not a `getServerSideProps` page. x-ref: https://github.com/vercel/next...
test/production/required-server-files-i18n.test.ts
@@ -448,7 +448,7 @@ describe('should set-up next', () => { const html3 = await renderViaHTTP( appPort, - '/catch-all/[[..rest]]', + '/catch-all/[[...rest]]', undefined, { headers: { @@ -732,7 +732,7 @@ describe('should set-up next', () => { }) it('should match the ...
true
Other
vercel
next.js
6f698405dda99ef791bf3b8ac86020b7997a9e77.json
Update matched path params priority (#37646) This ensures we use the correct dynamic route params favoring params from the URL/matched-path over route-matches. This also ensures we properly cache `_next/data` requests client side when the page is not a `getServerSideProps` page. x-ref: https://github.com/vercel/next...
test/production/required-server-files.test.ts
@@ -494,6 +494,59 @@ describe('should set-up next', () => { expect(data2.random).not.toBe(data.random) }) + it('should favor valid route params over routes-matches', async () => { + const html = await renderViaHTTP(appPort, '/fallback/first', undefined, { + headers: { + 'x-matched-path': '/fal...
true
Other
vercel
next.js
6108f10799b46bc0ef97373c913e23714e135942.json
feat(next export): add warning if using getInitialProps (#37642) This PR builds on the work from @hattakdev (PR went stale: https://github.com/vercel/next.js/pull/14499) and adds a new `integration` test for the new warning. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x]...
errors/get-initial-props-export.md
@@ -0,0 +1,15 @@ +# getInitialProps Export Warning + +#### Why This Warning Occurred + +You attempted to statically export your application via `next export`, however, one or more of your pages uses `getInitialProps`. + +Next.js discourages you to use `getInitialProps` in this scenario. + +#### Possible Ways to Fix It ...
true
Other
vercel
next.js
6108f10799b46bc0ef97373c913e23714e135942.json
feat(next export): add warning if using getInitialProps (#37642) This PR builds on the work from @hattakdev (PR went stale: https://github.com/vercel/next.js/pull/14499) and adds a new `integration` test for the new warning. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x]...
errors/manifest.json
@@ -677,6 +677,10 @@ { "title": "middleware-user-agent.md", "path": "/errors/middleware-user-agent.md" + }, + { + "title": "get-initial-props-export", + "path": "/errors/get-initial-props-export.md" } ] }
true
Other
vercel
next.js
6108f10799b46bc0ef97373c913e23714e135942.json
feat(next export): add warning if using getInitialProps (#37642) This PR builds on the work from @hattakdev (PR went stale: https://github.com/vercel/next.js/pull/14499) and adds a new `integration` test for the new warning. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x]...
packages/next/server/render.tsx
@@ -551,6 +551,24 @@ export async function renderToHTML( const pageIsDynamic = isDynamicRoute(pathname) + const defaultErrorGetInitialProps = + pathname === '/_error' && + (Component as any).getInitialProps === + (Component as any).origGetInitialProps + + if ( + renderOpts.nextExport && + hasP...
true
Other
vercel
next.js
6108f10799b46bc0ef97373c913e23714e135942.json
feat(next export): add warning if using getInitialProps (#37642) This PR builds on the work from @hattakdev (PR went stale: https://github.com/vercel/next.js/pull/14499) and adds a new `integration` test for the new warning. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x]...
test/integration/auto-export-query-error/next.config.js
@@ -4,7 +4,7 @@ module.exports = { return { '/': { page: '/hello', query: { first: 'second' } }, '/amp': { page: '/amp' }, - '/ssr': { page: '/ssr' }, + '/ssr': { page: '/ssr', query: { another: 'one' } }, } }, }
true
Other
vercel
next.js
6108f10799b46bc0ef97373c913e23714e135942.json
feat(next export): add warning if using getInitialProps (#37642) This PR builds on the work from @hattakdev (PR went stale: https://github.com/vercel/next.js/pull/14499) and adds a new `integration` test for the new warning. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x]...
test/integration/auto-export-query-error/test/index.test.js
@@ -17,9 +17,9 @@ const runTests = () => { 'Error: you provided query values for / which is an auto-exported page. These can not be applied since the page can no longer be re-rendered on the server. To disable auto-export for this page add `getInitialProps`' ) - expect(stderr).not.toContain('/amp') - ...
true
Other
vercel
next.js
6108f10799b46bc0ef97373c913e23714e135942.json
feat(next export): add warning if using getInitialProps (#37642) This PR builds on the work from @hattakdev (PR went stale: https://github.com/vercel/next.js/pull/14499) and adds a new `integration` test for the new warning. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x]...
test/integration/export-getInitialProps-warn/next.config.js
@@ -0,0 +1,10 @@ +module.exports = { + exportPathMap: async function ( + defaultPathMap, + { dev, dir, outDir, distDir, buildId } + ) { + return { + '/': { page: '/' }, + } + }, +}
true
Other
vercel
next.js
6108f10799b46bc0ef97373c913e23714e135942.json
feat(next export): add warning if using getInitialProps (#37642) This PR builds on the work from @hattakdev (PR went stale: https://github.com/vercel/next.js/pull/14499) and adds a new `integration` test for the new warning. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x]...
test/integration/export-getInitialProps-warn/pages/index.js
@@ -0,0 +1,5 @@ +const Page = ({ name }) => <div>{`Hello, ${name}`}</div> + +Page.getInitialProps = () => ({ name: 'world' }) + +export default Page
true
Other
vercel
next.js
6108f10799b46bc0ef97373c913e23714e135942.json
feat(next export): add warning if using getInitialProps (#37642) This PR builds on the work from @hattakdev (PR went stale: https://github.com/vercel/next.js/pull/14499) and adds a new `integration` test for the new warning. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x]...
test/integration/export-getInitialProps-warn/test/index.test.js
@@ -0,0 +1,17 @@ +/* eslint-env jest */ + +import { join } from 'path' +import { nextBuild, nextExport } from 'next-test-utils' + +const appDir = join(__dirname, '../') +const outdir = join(appDir, 'out') + +describe('Export with getInitialProps', () => { + it('should show warning with next export', async () => { + ...
true
Other
vercel
next.js
934e5a483594ab111d57acdd99d42c686ec71c43.json
Update usage of example.com -> example.vercel.sh (#37630) * Update usage of example.com -> example.vercel.sh * another one * another flakey test
test/e2e/basepath.test.ts
@@ -38,7 +38,7 @@ describe('basePath', () => { }, { source: '/rewrite-no-basepath', - destination: 'https://example.com', + destination: 'https://example.vercel.sh', basePath: false, }, { @@ -757,7 +757,9 @@ desc...
true
Other
vercel
next.js
934e5a483594ab111d57acdd99d42c686ec71c43.json
Update usage of example.com -> example.vercel.sh (#37630) * Update usage of example.com -> example.vercel.sh * another one * another flakey test
test/e2e/middleware-general/app/middleware.js
@@ -131,7 +131,7 @@ export async function middleware(request) { const response = {} try { - await fetch('https://example.com', { signal }) + await fetch('https://example.vercel.sh', { signal }) } catch (err) { response.error = { name: err.name,
true
Other
vercel
next.js
934e5a483594ab111d57acdd99d42c686ec71c43.json
Update usage of example.com -> example.vercel.sh (#37630) * Update usage of example.com -> example.vercel.sh * another one * another flakey test
test/production/required-server-files/pages/api/optional/[[...rest]].js
@@ -4,6 +4,6 @@ export default async (req, res) => { url: req.url, query: req.query, // make sure fetch if polyfilled - example: await fetch('https://example.com').then((res) => res.text()), + example: await fetch('https://example.vercel.sh').then((res) => res.text()), }) }
true
Other
vercel
next.js
934e5a483594ab111d57acdd99d42c686ec71c43.json
Update usage of example.com -> example.vercel.sh (#37630) * Update usage of example.com -> example.vercel.sh * another one * another flakey test
test/production/required-server-files/pages/fallback/[slug].js
@@ -12,7 +12,7 @@ export const getStaticProps = ({ params }) => { export const getStaticPaths = async () => { // make sure fetch if polyfilled - await fetch('https://example.com').then((res) => res.text()) + await fetch('https://example.vercel.sh').then((res) => res.text()) return { paths: ['/fallback...
true
Other
vercel
next.js
934e5a483594ab111d57acdd99d42c686ec71c43.json
Update usage of example.com -> example.vercel.sh (#37630) * Update usage of example.com -> example.vercel.sh * another one * another flakey test
test/production/required-server-files/pages/gssp.js
@@ -24,7 +24,9 @@ export async function getServerSideProps({ res }) { data, random: Math.random(), // make sure fetch if polyfilled - example: await fetch('https://example.com').then((res) => res.text()), + example: await fetch('https://example.vercel.sh').then((res) => + res.text(...
true
Other
vercel
next.js
0bfdf0e0d1bfa760ac375a5908fb110024e09a97.json
Fix react root env missing in NextServer (#37562) * Fix react root env missing in NextServer * switch to useId instead of using process.env var * add production test * extend timeout * fix test * fix lint * use version to detect if enable react root
packages/next/bin/next.ts
@@ -1,6 +1,7 @@ #!/usr/bin/env node import * as log from '../build/output/log' import arg from 'next/dist/compiled/arg/index.js' +import React from 'react' import { NON_STANDARD_NODE_ENV } from '../lib/constants' ;['react', 'react-dom'].forEach((dependency) => { try { @@ -42,9 +43,6 @@ const args = arg( } )...
true
Other
vercel
next.js
0bfdf0e0d1bfa760ac375a5908fb110024e09a97.json
Fix react root env missing in NextServer (#37562) * Fix react root env missing in NextServer * switch to useId instead of using process.env var * add production test * extend timeout * fix test * fix lint * use version to detect if enable react root
packages/next/server/next-server.ts
@@ -25,6 +25,7 @@ import type { import fs from 'fs' import { join, relative, resolve, sep } from 'path' import { IncomingMessage, ServerResponse } from 'http' +import React from 'react' import { addRequestMeta, getRequestMeta } from './request-meta' import { @@ -82,6 +83,11 @@ import { removeTrailingSlash } from...
true
Other
vercel
next.js
0bfdf0e0d1bfa760ac375a5908fb110024e09a97.json
Fix react root env missing in NextServer (#37562) * Fix react root env missing in NextServer * switch to useId instead of using process.env var * add production test * extend timeout * fix test * fix lint * use version to detect if enable react root
packages/next/server/next.ts
@@ -3,6 +3,7 @@ import type { NodeRequestHandler } from './next-server' import type { UrlWithParsedQuery } from 'url' import './node-polyfill-fetch' +import React from 'react' import { default as Server } from './next-server' import * as log from '../build/output/log' import loadConfig from './config' @@ -182,10...
true
Other
vercel
next.js
0bfdf0e0d1bfa760ac375a5908fb110024e09a97.json
Fix react root env missing in NextServer (#37562) * Fix react root env missing in NextServer * switch to useId instead of using process.env var * add production test * extend timeout * fix test * fix lint * use version to detect if enable react root
packages/next/server/render.tsx
@@ -88,9 +88,10 @@ let tryGetPreviewData: typeof import('./api-utils/node').tryGetPreviewData let warn: typeof import('../build/output/log').warn const DOCTYPE = '<!DOCTYPE html>' -const ReactDOMServer = process.env.__NEXT_REACT_ROOT - ? require('react-dom/server.browser') - : require('react-dom/server') +const R...
true
Other
vercel
next.js
0bfdf0e0d1bfa760ac375a5908fb110024e09a97.json
Fix react root env missing in NextServer (#37562) * Fix react root env missing in NextServer * switch to useId instead of using process.env var * add production test * extend timeout * fix test * fix lint * use version to detect if enable react root
test/production/react-18-streaming-ssr/custom-server/next.config.js
@@ -0,0 +1,5 @@ +module.exports = { + experimental: { + serverComponents: true, + }, +}
true
Other
vercel
next.js
0bfdf0e0d1bfa760ac375a5908fb110024e09a97.json
Fix react root env missing in NextServer (#37562) * Fix react root env missing in NextServer * switch to useId instead of using process.env var * add production test * extend timeout * fix test * fix lint * use version to detect if enable react root
test/production/react-18-streaming-ssr/custom-server/pages/index.server.js
@@ -0,0 +1,7 @@ +export default function Page() { + return <p>streaming</p> +} + +export async function getServerSideProps() { + return { props: {} } +}
true