diff --git a/bench/nested-deps-app-router/package.json b/bench/nested-deps-app-router/package.json index ead6a2d7b7fd9..b6663ecedd36f 100644 --- a/bench/nested-deps-app-router/package.json +++ b/bench/nested-deps-app-router/package.json @@ -2,10 +2,10 @@ "name": "bench-nested-deps-app-router", "scripts": { "prepare-bench": "rimraf components && fuzzponent -d 2 -s 206 -o components", - "dev": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 next dev", + "dev-application": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 next dev", "build-application": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 next build", "start": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 next start", - "dev-nocache": "rimraf .next && pnpm dev", + "dev-nocache": "rimraf .next && pnpm dev-application", "dev-cpuprofile-nocache": "rimraf .next && cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 node --cpu-prof ../../node_modules/next/dist/bin/next", "build-nocache": "rimraf .next && pnpm build-application" }, diff --git a/bench/nested-deps/package.json b/bench/nested-deps/package.json index dd4484b996184..2decc5ba1c34f 100644 --- a/bench/nested-deps/package.json +++ b/bench/nested-deps/package.json @@ -2,10 +2,10 @@ "name": "bench-nested-deps", "scripts": { "prepare-bench": "rimraf components && fuzzponent -d 2 -s 206 -o components", - "dev": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 next dev", + "dev-application": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 next dev", "build-application": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 next build", "start": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 next start", - "dev-nocache": "rimraf .next && pnpm dev", + "dev-nocache": "rimraf .next && pnpm dev-application", "dev-cpuprofile-nocache": "rimraf .next && cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 node --cpu-prof ../../node_modules/next/dist/bin/next", "build-nocache": "rimraf .next && pnpm build-application" }, diff --git a/docs/02-app/01-building-your-application/01-routing/10-route-handlers.mdx b/docs/02-app/01-building-your-application/01-routing/10-route-handlers.mdx index 5e53df7e3eb10..4a444cb9f72b5 100644 --- a/docs/02-app/01-building-your-application/01-routing/10-route-handlers.mdx +++ b/docs/02-app/01-building-your-application/01-routing/10-route-handlers.mdx @@ -388,7 +388,7 @@ export async function GET(request, { params }) { ### Streaming -Streaming is commonly used in combination with Large Language Models (LLMs), such an OpenAI, for AI-generated content. Learn more about the [AI SDK](https://sdk.vercel.ai/docs). +Streaming is commonly used in combination with Large Language Models (LLMs), such as OpenAI, for AI-generated content. Learn more about the [AI SDK](https://sdk.vercel.ai/docs). ```ts filename="app/api/chat/route.ts" switcher import { Configuration, OpenAIApi } from 'openai-edge' diff --git a/packages/font/src/google/font-data.json b/packages/font/src/google/font-data.json index bfa950f0f7046..8f03ff077770e 100644 --- a/packages/font/src/google/font-data.json +++ b/packages/font/src/google/font-data.json @@ -10578,6 +10578,11 @@ "styles": ["normal"], "subsets": ["latin", "latin-ext"] }, + "Pushster": { + "weights": ["400"], + "styles": ["normal"], + "subsets": ["latin", "latin-ext"] + }, "Qahiri": { "weights": ["400"], "styles": ["normal"], diff --git a/packages/font/src/google/index.ts b/packages/font/src/google/index.ts index 2bd917b6e734d..e5f34e794268f 100644 --- a/packages/font/src/google/index.ts +++ b/packages/font/src/google/index.ts @@ -18231,6 +18231,18 @@ export declare function Purple_Purse< adjustFontFallback?: boolean subsets?: Array<'latin' | 'latin-ext'> }): T extends undefined ? NextFont : NextFontWithVariable +export declare function Pushster< + T extends CssVariable | undefined = undefined +>(options: { + weight: '400' | Array<'400'> + style?: 'normal' | Array<'normal'> + display?: Display + variable?: T + preload?: boolean + fallback?: string[] + adjustFontFallback?: boolean + subsets?: Array<'latin' | 'latin-ext'> +}): T extends undefined ? NextFont : NextFontWithVariable export declare function Qahiri< T extends CssVariable | undefined = undefined >(options: { diff --git a/packages/next/src/build/analysis/get-page-static-info.ts b/packages/next/src/build/analysis/get-page-static-info.ts index 6d6cc421f895f..ec08c72f4a6c6 100644 --- a/packages/next/src/build/analysis/get-page-static-info.ts +++ b/packages/next/src/build/analysis/get-page-static-info.ts @@ -286,8 +286,9 @@ async function tryToReadFile(filePath: string, shouldThrow: boolean) { return await fs.readFile(filePath, { encoding: 'utf8', }) - } catch (error) { + } catch (error: any) { if (shouldThrow) { + error.message = `Next.js ERROR: Failed to read file ${filePath}:\n${error.message}` throw error } } diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index c0fde0830c4c1..a86398b9d5658 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -2865,7 +2865,6 @@ export default async function build( // If there's /not-found inside app, we prefer it over the pages 404 if (hasStaticApp404) { - // await moveExportedPage('/_error', '/404', '/404', false, 'html') await moveExportedAppNotFoundTo404() } else { // Only move /404 to /404 when there is no custom 404 as in that case we don't know about the 404 page diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 2ca96b4d71d94..e684b766fd995 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -115,12 +115,7 @@ const edgeConditionNames = [ const mainFieldsPerCompiler: Record = { [COMPILER_NAMES.server]: ['main', 'module'], [COMPILER_NAMES.client]: ['browser', 'module', 'main'], - [COMPILER_NAMES.edgeServer]: [ - 'edge-light', - 'worker', - // inherits the default conditions - '...', - ], + [COMPILER_NAMES.edgeServer]: edgeConditionNames, } const BABEL_CONFIG_FILES = [ diff --git a/packages/next/src/lib/worker.ts b/packages/next/src/lib/worker.ts index edba72894e76f..5beecff8c70ff 100644 --- a/packages/next/src/lib/worker.ts +++ b/packages/next/src/lib/worker.ts @@ -5,6 +5,14 @@ type FarmOptions = ConstructorParameters[1] const RESTARTED = Symbol('restarted') +const cleanupWorkers = (worker: JestWorker) => { + for (const curWorker of ((worker as any)._workerPool?._workers || []) as { + _child?: ChildProcess + }[]) { + curWorker._child?.kill('SIGINT') + } +} + export class Worker { private _worker: JestWorker | undefined @@ -123,6 +131,7 @@ export class Worker { if (!worker) { throw new Error('Farm is ended, no more calls can be done to it') } + cleanupWorkers(worker) this._worker = undefined return worker.end() } @@ -132,6 +141,7 @@ export class Worker { */ close(): void { if (this._worker) { + cleanupWorkers(this._worker) this._worker.end() } } diff --git a/packages/next/src/server/lib/find-page-file.ts b/packages/next/src/server/lib/find-page-file.ts index b3d01383b68d6..155462775ba9b 100644 --- a/packages/next/src/server/lib/find-page-file.ts +++ b/packages/next/src/server/lib/find-page-file.ts @@ -91,7 +91,7 @@ export function createValidFileMatcher( pageExtensions )}$` ) - const leafOnlyNotFoundFileRegex = new RegExp( + const rootNotFoundFileRegex = new RegExp( `^not-found\\.${getExtensionRegexString(pageExtensions)}$` ) /** TODO-METADATA: support other metadata routes @@ -136,7 +136,7 @@ export function createValidFileMatcher( return false } const rest = filePath.slice(appDirPath.length + 1) - return leafOnlyNotFoundFileRegex.test(rest) + return rootNotFoundFileRegex.test(rest) } return {