next 15.2.0-canary.47 → 15.2.0-canary.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/app-dir/link.d.ts +108 -28
- package/dist/client/app-dir/link.js +6 -4
- package/dist/client/app-dir/link.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +3 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +8 -6
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/use-error-hook.js +2 -3
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/use-error-hook.js.map +1 -1
- package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js +39 -13
- package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
- package/dist/client/components/react-dev-overlay/server/middleware-webpack.js +13 -3
- package/dist/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/app-page.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +6 -6
- package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/app-dir/link.js +6 -4
- package/dist/esm/client/app-dir/link.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +3 -2
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +8 -6
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/use-error-hook.js +2 -3
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/use-error-hook.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js +39 -13
- package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js +13 -3
- package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/lib/metadata/types/metadata-interface.js +13 -1
- package/dist/esm/lib/metadata/types/metadata-interface.js.map +1 -1
- package/dist/esm/server/config.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/server/patch-error-inspect.js +42 -15
- package/dist/esm/server/patch-error-inspect.js.map +1 -1
- package/dist/lib/metadata/types/metadata-interface.d.ts +252 -179
- package/dist/lib/metadata/types/metadata-interface.js +13 -1
- package/dist/lib/metadata/types/metadata-interface.js.map +1 -1
- package/dist/server/config.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/server/patch-error-inspect.js +42 -15
- package/dist/server/patch-error-inspect.js.map +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Next.js Metadata API
|
|
3
|
+
*
|
|
4
|
+
* This file defines the types used by Next.js to configure metadata
|
|
5
|
+
* through static exports or dynamic `generateMetadata` functions in Server Components.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* - The static `metadata` object and `generateMetadata` function are only supported in Server Components.
|
|
9
|
+
* - Do not export both a `metadata` object and a `generateMetadata` function from the same route segment.
|
|
10
|
+
* - You can still render metadata in client components directly as part of the component's JSX.
|
|
11
|
+
*
|
|
12
|
+
* @see https://nextjs.org/docs/app/api-reference/metadata
|
|
13
|
+
*/ "use strict";
|
|
2
14
|
Object.defineProperty(exports, "__esModule", {
|
|
3
15
|
value: true
|
|
4
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/metadata/types/metadata-interface.ts"],"sourcesContent":["/**\n * Next.js Metadata API\n *\n * This file defines the types used by Next.js to configure metadata\n * through static exports or dynamic `generateMetadata` functions in Server Components.\n *\n * @remarks\n * - The static `metadata` object and `generateMetadata` function are only supported in Server Components.\n * - Do not export both a `metadata` object and a `generateMetadata` function from the same route segment.\n * - You can still render metadata in client components directly as part of the component's JSX.\n *\n * @see https://nextjs.org/docs/app/api-reference/metadata\n */\n\nimport type {\n AlternateURLs,\n Languages,\n ResolvedAlternateURLs,\n} from './alternative-urls-types'\nimport type {\n AppleWebApp,\n AppLinks,\n Facebook,\n FormatDetection,\n ItunesApp,\n ResolvedAppleWebApp,\n ResolvedAppLinks,\n ResolvedFacebook,\n ViewportLayout,\n} from './extra-types'\nimport type {\n DeprecatedMetadataFields,\n AbsoluteTemplateString,\n Author,\n ColorSchemeEnum,\n Icon,\n Icons,\n IconURL,\n ReferrerEnum,\n ResolvedIcons,\n ResolvedVerification,\n Robots,\n ResolvedRobots,\n TemplateString,\n Verification,\n ThemeColorDescriptor,\n Videos,\n} from './metadata-types'\nimport type { Manifest as ManifestFile } from './manifest-types'\nimport type { OpenGraph, ResolvedOpenGraph } from './opengraph-types'\nimport type { ResolvedTwitterMetadata, Twitter } from './twitter-types'\n\n/**\n * Metadata interface to describe all the metadata fields that can be set in a document.\n *\n * @remarks\n * This interface covers all the metadata fields available in Next.js including title, description,\n * icons, openGraph, twitter, and more. Fields such as `metadataBase` help in composing absolute URLs\n * from relative ones. The `title` field supports both simple strings and a template object with `default`,\n * `template`, and `absolute` properties.\n *\n * @example\n * ```tsx\n * // Static metadata export in a layout or page:\n * import type { Metadata } from 'next'\n *\n * export const metadata: Metadata = {\n * metadataBase: new URL('https://example.com'),\n * title: { default: 'My Site', template: '%s | My Site' },\n * description: 'Welcome to My Site',\n * alternates: {\n * canonical: 'https://example.com',\n * languages: {\n * 'en-US': 'https://example.com/en-US',\n * 'de-DE': 'https://example.com/de-DE'\n * }\n * },\n * openGraph: {\n * title: 'My Site',\n * description: 'Welcome to My Site',\n * url: 'https://example.com',\n * siteName: 'My Site',\n * images: [{ url: 'https://example.com/og.png' }]\n * },\n * }\n * ```\n */\ninterface Metadata extends DeprecatedMetadataFields {\n /**\n * The base path and origin for absolute URLs in various metadata fields.\n *\n * @remarks\n * When relative URLs (for Open Graph images, alternates, etc.) are used, they are composed with this base.\n * If not provided, Next.js will populate a default value based on environment variables.\n */\n metadataBase?: null | URL | undefined\n\n /**\n * The document title.\n *\n * @remarks\n * The title can be a simple string (e.g., `\"My Blog\"`) or an object with:\n * - `default`: A fallback title for child segments.\n * - `template`: A title template (e.g., `\"%s | My Website\"`) applied to child titles.\n * - `absolute`: A title that overrides parent templates.\n *\n * @example\n * ```tsx\n * // As a simple string:\n * title: \"My Blog\"\n *\n * // As a template object:\n * title: { default: \"Dashboard\", template: \"%s | My Website\" }\n *\n * // Using absolute value (ignores parent template):\n * title: { absolute: \"My Blog\", template: \"%s | My Website\" }\n * ```\n */\n title?: null | string | TemplateString | undefined\n\n /**\n * The document description, and optionally the Open Graph and Twitter descriptions.\n *\n * @example\n * ```tsx\n * description: \"My Blog Description\"\n * // Renders: <meta name=\"description\" content=\"My Blog Description\" />\n * ```\n */\n description?: null | string | undefined\n\n // Standard metadata names\n // https://developer.mozilla.org/docs/Web/HTML/Element/meta/name\n\n /**\n * The application name.\n *\n * @example\n * ```tsx\n * applicationName: \"My Blog\"\n * // Renders: <meta name=\"application-name\" content=\"My Blog\" />\n * ```\n */\n applicationName?: null | string | undefined\n\n /**\n * The authors of the document.\n *\n * @example\n * ```tsx\n * authors: [{ name: \"Next.js Team\", url: \"https://nextjs.org\" }]\n * // Renders:\n * // <meta name=\"author\" content=\"Next.js Team\" />\n * // <link rel=\"author\" href=\"https://nextjs.org\" />\n * ```\n */\n authors?: null | Author | Array<Author> | undefined\n\n /**\n * The generator used for the document.\n *\n * @example\n * ```tsx\n * generator: \"Next.js\"\n * // Renders: <meta name=\"generator\" content=\"Next.js\" />\n * ```\n */\n generator?: null | string | undefined\n\n /**\n * The keywords for the document.\n *\n * @remarks\n * When an array is provided, keywords are flattened into a comma-separated string.\n *\n * @example\n * ```tsx\n * keywords: \"nextjs, react, blog\"\n * // or\n * keywords: [\"react\", \"server components\"]\n * ```\n */\n keywords?: null | string | Array<string> | undefined\n\n /**\n * The referrer setting for the document.\n *\n * @example\n * ```tsx\n * referrer: \"origin\"\n * // Renders: <meta name=\"referrer\" content=\"origin\" />\n * ```\n */\n referrer?: null | ReferrerEnum | undefined\n\n /**\n * The theme color for the document.\n *\n * @deprecated Use the new viewport configuration (`export const viewport: Viewport = { ... }`) instead.\n */\n themeColor?:\n | null\n | string\n | ThemeColorDescriptor\n | ThemeColorDescriptor[]\n | undefined\n\n /**\n * The color scheme for the document.\n *\n * @deprecated Use the new viewport configuration (`export const viewport: Viewport = { ... }`) instead.\n */\n colorScheme?: null | ColorSchemeEnum | undefined\n\n /**\n * The viewport setting for the document.\n *\n * @deprecated Use the new viewport configuration (`export const viewport: Viewport = { ... }`) instead.\n */\n viewport?: null | string | ViewportLayout | undefined\n\n /**\n * The creator of the document.\n *\n * @example\n * ```tsx\n * creator: \"Next.js Team\"\n * // Renders: <meta name=\"creator\" content=\"Next.js Team\" />\n * ```\n */\n creator?: null | string | undefined\n\n /**\n * The publisher of the document.\n *\n * @example\n * ```tsx\n * publisher: \"Vercel\"\n * // Renders: <meta name=\"publisher\" content=\"Vercel\" />\n * ```\n */\n publisher?: null | string | undefined\n\n // https://developer.mozilla.org/docs/Web/HTML/Element/meta/name#other_metadata_names\n\n /**\n * The robots setting for the document.\n *\n * @remarks\n * Can be a string (e.g., \"index, follow\") or an object with more granular rules.\n *\n * @example\n * ```tsx\n * robots: \"index, follow\"\n * // or\n * robots: { index: true, follow: true }\n * ```\n *\n * @see https://developer.mozilla.org/docs/Glossary/Robots.txt\n */\n robots?: null | string | Robots | undefined\n\n /**\n * The canonical and alternate URLs for the document.\n *\n * @remarks\n * This field allows defining a canonical URL as well as alternate URLs (such as for multiple languages).\n *\n * @example\n * ```tsx\n * alternates: {\n * canonical: \"https://example.com\",\n * languages: {\n * \"en-US\": \"https://example.com/en-US\"\n * }\n * }\n * ```\n */\n alternates?: null | AlternateURLs | undefined\n\n /**\n * The icons for the document. Defaults to rel=\"icon\".\n *\n * @remarks\n * You can specify a simple URL or an object to differentiate between icon types (e.g., apple-touch-icon).\n *\n * @example\n * ```tsx\n * icons: \"https://example.com/icon.png\"\n * // or\n * icons: {\n * icon: \"https://example.com/icon.png\",\n * apple: \"https://example.com/apple-icon.png\"\n * }\n * ```\n *\n * @see https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-icon\n */\n icons?: null | IconURL | Array<Icon> | Icons | undefined\n\n /**\n * A web application manifest, as defined in the Web Application Manifest specification.\n *\n * @example\n * ```tsx\n * manifest: \"https://example.com/manifest.json\"\n * // Renders: <link rel=\"manifest\" href=\"https://example.com/manifest.json\" />\n * ```\n *\n * @see https://developer.mozilla.org/docs/Web/Manifest\n */\n manifest?: null | string | URL | undefined\n\n /**\n * The Open Graph metadata for the document.\n *\n * @remarks\n * Follows the Open Graph protocol to enrich link previews.\n *\n * @example\n * ```tsx\n * openGraph: {\n * type: \"website\",\n * url: \"https://example.com\",\n * title: \"My Website\",\n * description: \"My Website Description\",\n * siteName: \"My Website\",\n * images: [{ url: \"https://example.com/og.png\" }]\n * }\n * ```\n *\n * @see https://ogp.me/\n */\n openGraph?: null | OpenGraph | undefined\n\n /**\n * The Twitter metadata for the document.\n *\n * @remarks\n * - Used for configuring Twitter Cards and can include details such as `card`, `site`, and `creator`.\n * - Notably, more sites than just Twitter (now X) use this format.\n *\n * @example\n * ```tsx\n * twitter: {\n * card: \"summary_large_image\",\n * site: \"@site\",\n * creator: \"@creator\",\n * images: \"https://example.com/og.png\"\n * }\n * ```\n */\n twitter?: null | Twitter | undefined\n\n /**\n * The Facebook metadata for the document.\n *\n * @remarks\n * Specify either `appId` or `admins` (but not both) to configure Facebook integration.\n *\n * @example\n * ```tsx\n * facebook: { appId: \"12345678\" }\n * // Renders <meta property=\"fb:app_id\" content=\"12345678\" />\n * // or\n * facebook: { admins: [\"12345678\"] }\n * // Renders <meta property=\"fb:admins\" content=\"12345678\" />\n * ```\n */\n facebook?: null | Facebook | undefined\n\n /**\n * The common verification tokens for the document.\n *\n * @example\n * ```tsx\n * verification: { google: \"1234567890\", yandex: \"1234567890\", \"me\": \"1234567890\" }\n * // Renders <meta name=\"google-site-verification\" content=\"1234567890\" />\n * // <meta name=\"yandex-verification\" content=\"1234567890\" />\n * // <meta name=\"me\" content=\"@me\" />\n * ```\n */\n verification?: Verification | undefined\n\n /**\n * The Apple web app metadata for the document.\n *\n * @example\n * ```tsx\n * appleWebApp: { capable: true, title: \"My Website\", statusBarStyle: \"black-translucent\" }\n * ```\n *\n * @see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html\n */\n appleWebApp?: null | boolean | AppleWebApp | undefined\n\n /**\n * Indicates whether devices should interpret certain formats (such as telephone numbers) as actionable links.\n *\n * @example\n * ```tsx\n * formatDetection: { telephone: false }\n * // Renders: <meta name=\"format-detection\" content=\"telephone=no\" />\n * ```\n */\n formatDetection?: null | FormatDetection | undefined\n\n /**\n * The metadata for the iTunes App.\n *\n * @remarks\n * Adds the `name=\"apple-itunes-app\"` meta tag.\n *\n * @example\n * ```tsx\n * itunes: { app: { id: \"123456789\", affiliateData: \"123456789\", appArguments: \"123456789\" } }\n * // Renders <meta name=\"apple-itunes-app\" content=\"app-id=123456789, affiliate-data=123456789, app-arguments=123456789\" />\n * ```\n */\n itunes?: null | ItunesApp | undefined\n\n /**\n * A brief description of the web page.\n *\n * @remarks\n * Rendered as the `abstract` meta tag. This is *not recommended* as it is superseded by `description`.\n *\n * @example\n * ```tsx\n * abstract: \"My Website Description\"\n * // Renders <meta name=\"abstract\" content=\"My Website Description\" />\n * ```\n */\n abstract?: null | string | undefined\n\n /**\n * The Facebook AppLinks metadata for the document.\n *\n * @example\n * ```tsx\n * appLinks: {\n * ios: { appStoreId: \"123456789\", url: \"https://example.com\" },\n * android: { packageName: \"com.example\", url: \"https://example.com\" }\n * }\n *\n * // Renders\n * <meta property=\"al:ios:app_store_id\" content=\"123456789\" />\n * <meta property=\"al:ios:url\" content=\"https://example.com\" />\n * <meta property=\"al:android:package\" content=\"com.example\" />\n * <meta property=\"al:android:url\" content=\"https://example.com\" />\n * ```\n */\n appLinks?: null | AppLinks | undefined\n\n /**\n * The archives link rel property.\n *\n * @example\n * ```tsx\n * archives: \"https://example.com/archives\"\n * // Renders <link rel=\"archives\" href=\"https://example.com/archives\" />\n * ```\n */\n archives?: null | string | Array<string> | undefined\n\n /**\n * The assets link rel property.\n *\n * @example\n * ```tsx\n * assets: \"https://example.com/assets\"\n * // Renders <link rel=\"assets\" href=\"https://example.com/assets\" />\n * ```\n */\n assets?: null | string | Array<string> | undefined\n\n /**\n * The bookmarks link rel property.\n *\n * @remarks\n * Although technically against the HTML spec, this is used in practice.\n *\n * @example\n * ```tsx\n * bookmarks: \"https://example.com/bookmarks\"\n * // Renders <link rel=\"bookmarks\" href=\"https://example.com/bookmarks\" />\n * ```\n */\n bookmarks?: null | string | Array<string> | undefined\n\n /**\n * The pagination link rel properties.\n *\n * @example\n * ```tsx\n * pagination: {\n * previous: \"https://example.com/items?page=1\",\n * next: \"https://example.com/items?page=3\"\n * }\n *\n * // Renders\n * <link rel=\"prev\" href=\"https://example.com/items?page=1\" />\n * <link rel=\"next\" href=\"https://example.com/items?page=3\" />\n * ```\n *\n * @see https://developers.google.com/search/blog/2011/09/pagination-with-relnext-and-relprev\n */\n pagination?: {\n previous?: null | string | URL | undefined\n next?: null | string | URL | undefined\n }\n\n /**\n * The category meta name property.\n *\n * @example\n * ```tsx\n * category: \"My Category\"\n * // Renders <meta name=\"category\" content=\"My Category\" />\n * ```\n */\n category?: null | string | undefined\n\n /**\n * The classification meta name property.\n *\n * @example\n * ```tsx\n * classification: \"My Classification\"\n * // Renders <meta name=\"classification\" content=\"My Classification\" />\n * ```\n */\n classification?: null | string | undefined\n\n /**\n * Arbitrary name/value pairs for additional metadata.\n *\n * @remarks\n * Use this field to define custom meta tags that are not directly supported.\n *\n * @example\n * ```tsx\n * other: { custom: [\"meta1\", \"meta2\"] }\n * ```\n */\n other?:\n | ({\n [name: string]: string | number | Array<string | number>\n } & DeprecatedMetadataFields)\n | undefined\n}\n\n/**\n * ResolvedMetadata represents the fully processed metadata after defaults are applied\n * and relative URLs are composed with `metadataBase`.\n */\ninterface ResolvedMetadata extends DeprecatedMetadataFields {\n // origin and base path for absolute urls for various metadata links such as\n // opengraph-image\n metadataBase: null | URL\n\n // The Document title and template if defined\n title: null | AbsoluteTemplateString\n\n // The Document description, and optionally the opengraph and twitter descriptions\n description: null | string\n\n // Standard metadata names\n // https://developer.mozilla.org/docs/Web/HTML/Element/meta/name\n applicationName: null | string\n authors: null | Array<Author>\n generator: null | string\n // if you provide an array it will be flattened into a single tag with comma separation\n keywords: null | Array<string>\n referrer: null | ReferrerEnum\n /**\n * @deprecated\n */\n themeColor: null | ThemeColorDescriptor[]\n /**\n * @deprecated\n */\n colorScheme: null | ColorSchemeEnum\n /**\n * @deprecated\n */\n viewport: null | string\n creator: null | string\n publisher: null | string\n\n // https://developer.mozilla.org/docs/Web/HTML/Element/meta/name#other_metadata_names\n robots: null | ResolvedRobots\n\n // The canonical and alternate URLs for this location\n alternates: null | ResolvedAlternateURLs\n\n // Defaults to rel=\"icon\" but the Icons type can be used\n // to get more specific about rel types\n icons: null | ResolvedIcons\n\n openGraph: null | ResolvedOpenGraph\n\n manifest: null | string | URL\n\n twitter: null | ResolvedTwitterMetadata\n\n facebook: null | ResolvedFacebook\n\n // common verification tokens\n verification: null | ResolvedVerification\n\n // Apple web app metadata\n // https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html\n appleWebApp: null | ResolvedAppleWebApp\n\n // Should devices try to interpret various formats and make actionable links\n // out of them? The canonical example is telephone numbers on mobile that can\n // be clicked to dial\n formatDetection: null | FormatDetection\n\n // meta name=\"apple-itunes-app\"\n itunes: null | ItunesApp\n\n // meta name=\"abstract\"\n // A brief description of what this web-page is about.\n // Not recommended, superceded by description.\n // https://www.metatags.org/all-meta-tags-overview/meta-name-abstract/\n abstract: null | string\n\n // Facebook AppLinks\n appLinks: null | ResolvedAppLinks\n\n // link rel properties\n archives: null | Array<string>\n assets: null | Array<string>\n bookmarks: null | Array<string> // This is technically against HTML spec but is used in wild\n pagination: {\n previous: null | string\n next: null | string\n }\n\n // meta name properties\n category: null | string\n classification: null | string\n other:\n | null\n | ({\n [name: string]: string | number | Array<string | number>\n } & DeprecatedMetadataFields)\n}\n\ntype RobotsFile = {\n // Apply rules for all\n rules:\n | {\n userAgent?: string | string[] | undefined\n allow?: string | string[] | undefined\n disallow?: string | string[] | undefined\n crawlDelay?: number | undefined\n }\n // Apply rules for specific user agents\n | Array<{\n userAgent: string | string[]\n allow?: string | string[] | undefined\n disallow?: string | string[] | undefined\n crawlDelay?: number | undefined\n }>\n sitemap?: string | string[] | undefined\n host?: string | undefined\n}\n\ntype SitemapFile = Array<{\n url: string\n lastModified?: string | Date | undefined\n changeFrequency?:\n | 'always'\n | 'hourly'\n | 'daily'\n | 'weekly'\n | 'monthly'\n | 'yearly'\n | 'never'\n | undefined\n priority?: number | undefined\n alternates?:\n | {\n languages?: Languages<string> | undefined\n }\n | undefined\n images?: string[] | undefined\n videos?: Videos[] | undefined\n}>\n\ntype ResolvingMetadata = Promise<ResolvedMetadata>\ndeclare namespace MetadataRoute {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n export type Robots = RobotsFile\n export type Sitemap = SitemapFile\n export type Manifest = ManifestFile\n}\n\n/**\n * Interface for the viewport configuration.\n *\n * @remarks\n * This configuration allows defining properties such as width, initial scale, theme colors,\n * and color scheme.\n *\n * @example\n * ```tsx\n * export const viewport: Viewport = {\n * width: \"device-width\",\n * initialScale: 1,\n * themeColor: [\n * { media: \"(prefers-color-scheme: dark)\", color: \"#000000\" },\n * { media: \"(prefers-color-scheme: light)\", color: \"#ffffff\" }\n * ],\n * colorScheme: \"dark\"\n * }\n * ```\n */\ninterface Viewport extends ViewportLayout {\n /**\n * The theme color for the document.\n *\n * @example\n * ```tsx\n * themeColor: \"#000000\"\n * // Renders <meta name=\"theme-color\" content=\"#000000\" />\n *\n * themeColor: { media: \"(prefers-color-scheme: dark)\", color: \"#000000\" }\n * // Renders <meta name=\"theme-color\" media=\"(prefers-color-scheme: dark)\" content=\"#000000\" />\n *\n * themeColor: [\n * { media: \"(prefers-color-scheme: dark)\", color: \"#000000\" },\n * { media: \"(prefers-color-scheme: light)\", color: \"#ffffff\" }\n * ]\n * // Renders <meta name=\"theme-color\" media=\"(prefers-color-scheme: dark)\" content=\"#000000\" />\n * // Renders <meta name=\"theme-color\" media=\"(prefers-color-scheme: light)\" content=\"#ffffff\" />\n * ```\n */\n themeColor?:\n | null\n | string\n | ThemeColorDescriptor\n | ThemeColorDescriptor[]\n | undefined\n\n /**\n * The color scheme for the document.\n *\n * @example\n * ```tsx\n * colorScheme: \"dark\"\n * // Renders <meta name=\"color-scheme\" content=\"dark\" />\n * ```\n */\n colorScheme?: null | ColorSchemeEnum | undefined\n}\n\ntype ResolvingViewport = Promise<Viewport>\n\ninterface ResolvedViewport extends ViewportLayout {\n themeColor: null | ThemeColorDescriptor[]\n colorScheme: null | ColorSchemeEnum\n}\n\nexport type {\n Metadata,\n ResolvedMetadata,\n ResolvingMetadata,\n MetadataRoute,\n Viewport,\n ResolvingViewport,\n ResolvedViewport,\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;CAYC"}
|
package/dist/server/config.js
CHANGED
|
@@ -256,7 +256,7 @@ function assignDefaults(dir, userConfig, silent) {
|
|
|
256
256
|
enumerable: false
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
|
-
if (!((_process_env___NEXT_VERSION = "15.2.0-canary.
|
|
259
|
+
if (!((_process_env___NEXT_VERSION = "15.2.0-canary.48") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV) {
|
|
260
260
|
var _result_experimental7, _result_experimental8, _result_experimental_turbo3, _result_experimental9;
|
|
261
261
|
// Prevents usage of certain experimental features outside of canary
|
|
262
262
|
if ((_result_experimental7 = result.experimental) == null ? void 0 : _result_experimental7.ppr) {
|
|
@@ -136,7 +136,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
|
|
|
136
136
|
}
|
|
137
137
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
|
138
138
|
const hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
139
|
-
version: "15.2.0-canary.
|
|
139
|
+
version: "15.2.0-canary.48"
|
|
140
140
|
});
|
|
141
141
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
142
142
|
// of the current `next dev` invocation.
|
|
@@ -254,7 +254,7 @@ class HotReloaderWebpack {
|
|
|
254
254
|
this.previewProps = previewProps;
|
|
255
255
|
this.rewrites = rewrites;
|
|
256
256
|
this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
257
|
-
version: "15.2.0-canary.
|
|
257
|
+
version: "15.2.0-canary.48"
|
|
258
258
|
});
|
|
259
259
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
260
260
|
// of the current `next dev` invocation.
|
|
@@ -67,7 +67,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
67
67
|
return newObj;
|
|
68
68
|
}
|
|
69
69
|
function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, maxExperimentalFeatures = Infinity }) {
|
|
70
|
-
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.2.0-canary.
|
|
70
|
+
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.2.0-canary.48"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
|
|
71
71
|
if (appUrl) {
|
|
72
72
|
_log.bootstrap(`- Local: ${appUrl}`);
|
|
73
73
|
}
|
|
@@ -111,7 +111,7 @@ async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup, server
|
|
|
111
111
|
async function startServer(serverOptions) {
|
|
112
112
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
|
113
113
|
let { port } = serverOptions;
|
|
114
|
-
process.title = `next-server (v${"15.2.0-canary.
|
|
114
|
+
process.title = `next-server (v${"15.2.0-canary.48"})`;
|
|
115
115
|
let handlersReady = ()=>{};
|
|
116
116
|
let handlersError = ()=>{};
|
|
117
117
|
let handlersPromise = new Promise((resolve, reject)=>{
|
|
@@ -140,6 +140,19 @@ function shouldIgnoreListOriginalFrame(file) {
|
|
|
140
140
|
return payload;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
+
function createUnsourcemappedFrame(frame) {
|
|
144
|
+
return {
|
|
145
|
+
stack: {
|
|
146
|
+
arguments: frame.arguments,
|
|
147
|
+
column: frame.column,
|
|
148
|
+
file: frame.file,
|
|
149
|
+
lineNumber: frame.lineNumber,
|
|
150
|
+
methodName: frame.methodName,
|
|
151
|
+
ignored: shouldIgnoreListGeneratedFrame(frame.file)
|
|
152
|
+
},
|
|
153
|
+
code: null
|
|
154
|
+
};
|
|
155
|
+
}
|
|
143
156
|
/**
|
|
144
157
|
* @param frame
|
|
145
158
|
* @param sourceMapCache
|
|
@@ -150,7 +163,6 @@ function shouldIgnoreListOriginalFrame(file) {
|
|
|
150
163
|
let sourceMapConsumer;
|
|
151
164
|
let sourceMapPayload;
|
|
152
165
|
if (sourceMapCacheEntry === undefined) {
|
|
153
|
-
var _nativeFindSourceMap;
|
|
154
166
|
let sourceURL = frame.file;
|
|
155
167
|
// e.g. "/APP/.next/server/chunks/ssr/[root of the server]__2934a0._.js"
|
|
156
168
|
// will be keyed by Node.js as "file:///APP/.next/server/chunks/ssr/[root%20of%20the%20server]__2934a0._.js".
|
|
@@ -158,23 +170,38 @@ function shouldIgnoreListOriginalFrame(file) {
|
|
|
158
170
|
if (sourceURL.startsWith('/')) {
|
|
159
171
|
sourceURL = _url.pathToFileURL(frame.file).toString();
|
|
160
172
|
}
|
|
161
|
-
|
|
173
|
+
let maybeSourceMapPayload;
|
|
174
|
+
try {
|
|
175
|
+
const sourceMap = (0, _module.findSourceMap)(sourceURL);
|
|
176
|
+
maybeSourceMapPayload = sourceMap == null ? void 0 : sourceMap.payload;
|
|
177
|
+
} catch (cause) {
|
|
178
|
+
// We should not log an actual error instance here because that will re-enter
|
|
179
|
+
// this codepath during error inspection and could lead to infinite recursion.
|
|
180
|
+
console.error(`${sourceURL}: Invalid source map. Only conformant source maps can be used to find the original code. Cause: ${cause}`);
|
|
181
|
+
// Don't even fall back to the bundler because it might be not as strict
|
|
182
|
+
// with regards to parsing and then we fail later once we consume the
|
|
183
|
+
// source map payload.
|
|
184
|
+
// This essentially avoids a redundant error where we fail here and then
|
|
185
|
+
// later on consumption because the bundler just handed back an invalid
|
|
186
|
+
// source map.
|
|
187
|
+
return createUnsourcemappedFrame(frame);
|
|
188
|
+
}
|
|
162
189
|
if (maybeSourceMapPayload === undefined) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
file: frame.file,
|
|
168
|
-
lineNumber: frame.lineNumber,
|
|
169
|
-
methodName: frame.methodName,
|
|
170
|
-
ignored: shouldIgnoreListGeneratedFrame(frame.file)
|
|
171
|
-
},
|
|
172
|
-
code: null
|
|
173
|
-
};
|
|
190
|
+
maybeSourceMapPayload = bundlerFindSourceMapPayload(sourceURL);
|
|
191
|
+
}
|
|
192
|
+
if (maybeSourceMapPayload === undefined) {
|
|
193
|
+
return createUnsourcemappedFrame(frame);
|
|
174
194
|
}
|
|
175
195
|
sourceMapPayload = maybeSourceMapPayload;
|
|
176
|
-
|
|
177
|
-
|
|
196
|
+
try {
|
|
197
|
+
sourceMapConsumer = new _sourcemap.SourceMapConsumer(// @ts-expect-error -- Module.SourceMap['version'] is number but SyncSourceMapConsumer wants a string
|
|
198
|
+
sourceMapPayload);
|
|
199
|
+
} catch (cause) {
|
|
200
|
+
// We should not log an actual error instance here because that will re-enter
|
|
201
|
+
// this codepath during error inspection and could lead to infinite recursion.
|
|
202
|
+
console.error(`${sourceURL}: Invalid source map. Only conformant source maps can be used to find the original code. Cause: ${cause}`);
|
|
203
|
+
return createUnsourcemappedFrame(frame);
|
|
204
|
+
}
|
|
178
205
|
sourceMapCache.set(frame.file, {
|
|
179
206
|
map: sourceMapConsumer,
|
|
180
207
|
payload: sourceMapPayload
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/server/patch-error-inspect.ts"],"sourcesContent":["import {\n findSourceMap as nativeFindSourceMap,\n type SourceMapPayload,\n} from 'module'\nimport * as path from 'path'\nimport * as url from 'url'\nimport type * as util from 'util'\nimport { SourceMapConsumer as SyncSourceMapConsumer } from 'next/dist/compiled/source-map'\nimport type { StackFrame } from 'next/dist/compiled/stacktrace-parser'\nimport { parseStack } from '../client/components/react-dev-overlay/server/middleware-webpack'\nimport { getOriginalCodeFrame } from '../client/components/react-dev-overlay/server/shared'\nimport { workUnitAsyncStorage } from './app-render/work-unit-async-storage.external'\nimport { dim } from '../lib/picocolors'\n\ntype FindSourceMapPayload = (\n sourceURL: string\n) => ModernSourceMapPayload | undefined\n// Find a source map using the bundler's API.\n// This is only a fallback for when Node.js fails to due to bugs e.g. https://github.com/nodejs/node/issues/52102\n// TODO: Remove once all supported Node.js versions are fixed.\n// TODO(veil): Set from Webpack as well\nlet bundlerFindSourceMapPayload: FindSourceMapPayload = () => undefined\n\nexport function setBundlerFindSourceMapImplementation(\n findSourceMapImplementation: FindSourceMapPayload\n): void {\n bundlerFindSourceMapPayload = findSourceMapImplementation\n}\n\n/**\n * https://tc39.es/source-map/#index-map\n */\ninterface IndexSourceMapSection {\n offset: {\n line: number\n column: number\n }\n map: ModernRawSourceMap\n}\n\n// TODO(veil): Upstream types\ninterface IndexSourceMap {\n version: number\n file: string\n sections: IndexSourceMapSection[]\n}\n\ninterface ModernRawSourceMap extends SourceMapPayload {\n ignoreList?: number[]\n}\n\nexport type ModernSourceMapPayload = ModernRawSourceMap | IndexSourceMap\n\ninterface IgnoreableStackFrame extends StackFrame {\n ignored: boolean\n}\n\ntype SourceMapCache = Map<\n string,\n { map: SyncSourceMapConsumer; payload: ModernSourceMapPayload }\n>\n\nfunction frameToString(frame: StackFrame): string {\n let sourceLocation = frame.lineNumber !== null ? `:${frame.lineNumber}` : ''\n if (frame.column !== null && sourceLocation !== '') {\n sourceLocation += `:${frame.column}`\n }\n\n let fileLocation: string | null\n if (\n frame.file !== null &&\n frame.file.startsWith('file://') &&\n URL.canParse(frame.file)\n ) {\n // If not relative to CWD, the path is ambiguous to IDEs and clicking will prompt to select the file first.\n // In a multi-app repo, this leads to potentially larger file names but will make clicking snappy.\n // There's no tradeoff for the cases where `dir` in `next dev [dir]` is omitted\n // since relative to cwd is both the shortest and snappiest.\n fileLocation = path.relative(process.cwd(), url.fileURLToPath(frame.file))\n } else if (frame.file !== null && frame.file.startsWith('/')) {\n fileLocation = path.relative(process.cwd(), frame.file)\n } else {\n fileLocation = frame.file\n }\n\n return frame.methodName\n ? ` at ${frame.methodName} (${fileLocation}${sourceLocation})`\n : ` at ${fileLocation}${sourceLocation}`\n}\n\nfunction computeErrorName(error: Error): string {\n // TODO: Node.js seems to use a different algorithm\n // class ReadonlyRequestCookiesError extends Error {}` would read `ReadonlyRequestCookiesError: [...]`\n // in the stack i.e. seems like under certain conditions it favors the constructor name.\n return error.name || 'Error'\n}\n\nfunction prepareUnsourcemappedStackTrace(\n error: Error,\n structuredStackTrace: any[]\n): string {\n const name = computeErrorName(error)\n const message = error.message || ''\n let stack = name + ': ' + message\n for (let i = 0; i < structuredStackTrace.length; i++) {\n stack += '\\n at ' + structuredStackTrace[i].toString()\n }\n return stack\n}\n\nfunction shouldIgnoreListGeneratedFrame(file: string): boolean {\n return file.startsWith('node:') || file.includes('node_modules')\n}\n\nfunction shouldIgnoreListOriginalFrame(file: string): boolean {\n return file.includes('node_modules')\n}\n\n/**\n * Finds the sourcemap payload applicable to a given frame.\n * Equal to the input unless an Index Source Map is used.\n */\nfunction findApplicableSourceMapPayload(\n frame: StackFrame,\n payload: ModernSourceMapPayload\n): ModernRawSourceMap | undefined {\n if ('sections' in payload) {\n const frameLine = frame.lineNumber ?? 0\n const frameColumn = frame.column ?? 0\n // Sections must not overlap and must be sorted: https://tc39.es/source-map/#section-object\n // Therefore the last section that has an offset less than or equal to the frame is the applicable one.\n // TODO(veil): Binary search\n let section: IndexSourceMapSection | undefined = payload.sections[0]\n for (\n let i = 0;\n i < payload.sections.length &&\n payload.sections[i].offset.line <= frameLine &&\n payload.sections[i].offset.column <= frameColumn;\n i++\n ) {\n section = payload.sections[i]\n }\n\n return section === undefined ? undefined : section.map\n } else {\n return payload\n }\n}\n\ninterface SourcemappableStackFrame extends StackFrame {\n file: NonNullable<StackFrame['file']>\n}\n\n/**\n * @param frame\n * @param sourceMapCache\n * @returns The original frame if not sourcemapped.\n */\nfunction getSourcemappedFrameIfPossible(\n frame: SourcemappableStackFrame,\n sourceMapCache: SourceMapCache,\n inspectOptions: util.InspectOptions\n): {\n stack: IgnoreableStackFrame\n // DEV only\n code: string | null\n} {\n const sourceMapCacheEntry = sourceMapCache.get(frame.file)\n let sourceMapConsumer: SyncSourceMapConsumer\n let sourceMapPayload: ModernSourceMapPayload\n if (sourceMapCacheEntry === undefined) {\n let sourceURL = frame.file\n // e.g. \"/APP/.next/server/chunks/ssr/[root of the server]__2934a0._.js\"\n // will be keyed by Node.js as \"file:///APP/.next/server/chunks/ssr/[root%20of%20the%20server]__2934a0._.js\".\n // This is likely caused by `callsite.toString()` in `Error.prepareStackTrace converting file URLs to paths.\n if (sourceURL.startsWith('/')) {\n sourceURL = url.pathToFileURL(frame.file).toString()\n }\n const maybeSourceMapPayload =\n nativeFindSourceMap(sourceURL)?.payload ??\n bundlerFindSourceMapPayload(sourceURL)\n if (maybeSourceMapPayload === undefined) {\n return {\n stack: {\n arguments: frame.arguments,\n column: frame.column,\n file: frame.file,\n lineNumber: frame.lineNumber,\n methodName: frame.methodName,\n ignored: shouldIgnoreListGeneratedFrame(frame.file),\n },\n code: null,\n }\n }\n sourceMapPayload = maybeSourceMapPayload\n sourceMapConsumer = new SyncSourceMapConsumer(\n // @ts-expect-error -- Module.SourceMap['version'] is number but SyncSourceMapConsumer wants a string\n sourceMapPayload\n )\n sourceMapCache.set(frame.file, {\n map: sourceMapConsumer,\n payload: sourceMapPayload,\n })\n } else {\n sourceMapConsumer = sourceMapCacheEntry.map\n sourceMapPayload = sourceMapCacheEntry.payload\n }\n\n const sourcePosition = sourceMapConsumer.originalPositionFor({\n column: frame.column ?? 0,\n line: frame.lineNumber ?? 1,\n })\n\n if (sourcePosition.source === null) {\n return {\n stack: {\n arguments: frame.arguments,\n column: frame.column,\n file: frame.file,\n lineNumber: frame.lineNumber,\n methodName: frame.methodName,\n ignored: shouldIgnoreListGeneratedFrame(frame.file),\n },\n code: null,\n }\n }\n\n const sourceContent: string | null =\n sourceMapConsumer.sourceContentFor(\n sourcePosition.source,\n /* returnNullOnMissing */ true\n ) ?? null\n\n const applicableSourceMap = findApplicableSourceMapPayload(\n frame,\n sourceMapPayload\n )\n // TODO(veil): Upstream a method to sourcemap consumer that immediately says if a frame is ignored or not.\n let ignored = false\n if (applicableSourceMap === undefined) {\n console.error('No applicable source map found in sections for frame', frame)\n } else if (shouldIgnoreListOriginalFrame(sourcePosition.source)) {\n // Externals may be libraries that don't ship ignoreLists.\n // This is really taking control away from libraries.\n // They should still ship `ignoreList` so that attached debuggers ignore-list their frames.\n // TODO: Maybe only ignore library sourcemaps if `ignoreList` is absent?\n // Though keep in mind that Turbopack omits empty `ignoreList`.\n // So if we establish this convention, we should communicate it to the ecosystem.\n ignored = true\n } else {\n // TODO: O(n^2). Consider moving `ignoreList` into a Set\n const sourceIndex = applicableSourceMap.sources.indexOf(\n sourcePosition.source\n )\n ignored = applicableSourceMap.ignoreList?.includes(sourceIndex) ?? false\n }\n\n const originalFrame: IgnoreableStackFrame = {\n // We ignore the sourcemapped name since it won't be the correct name.\n // The callsite will point to the column of the variable name instead of the\n // name of the enclosing function.\n // TODO(NDX-531): Spy on prepareStackTrace to get the enclosing line number for method name mapping.\n methodName: frame.methodName\n ?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default')\n ?.replace('__webpack_exports__.', ''),\n column: sourcePosition.column,\n file: sourcePosition.source,\n lineNumber: sourcePosition.line,\n // TODO: c&p from async createOriginalStackFrame but why not frame.arguments?\n arguments: [],\n ignored,\n }\n\n const codeFrame =\n process.env.NODE_ENV !== 'production'\n ? getOriginalCodeFrame(\n originalFrame,\n sourceContent,\n inspectOptions.colors\n )\n : null\n\n return {\n stack: originalFrame,\n code: codeFrame,\n }\n}\n\nfunction parseAndSourceMap(\n error: Error,\n inspectOptions: util.InspectOptions\n): string {\n // TODO(veil): Expose as CLI arg or config option. Useful for local debugging.\n const showIgnoreListed = false\n // We overwrote Error.prepareStackTrace earlier so error.stack is not sourcemapped.\n let unparsedStack = String(error.stack)\n // We could just read it from `error.stack`.\n // This works around cases where a 3rd party `Error.prepareStackTrace` implementation\n // doesn't implement the name computation correctly.\n const errorName = computeErrorName(error)\n\n let idx = unparsedStack.indexOf('react-stack-bottom-frame')\n if (idx !== -1) {\n idx = unparsedStack.lastIndexOf('\\n', idx)\n }\n if (idx !== -1 && !showIgnoreListed) {\n // Cut off everything after the bottom frame since it'll be React internals.\n unparsedStack = unparsedStack.slice(0, idx)\n }\n\n const unsourcemappedStack = parseStack(unparsedStack)\n const sourceMapCache: SourceMapCache = new Map()\n\n let sourceMappedStack = ''\n let sourceFrameDEV: null | string = null\n for (const frame of unsourcemappedStack) {\n if (frame.file === null) {\n sourceMappedStack += '\\n' + frameToString(frame)\n } else {\n const sourcemappedFrame = getSourcemappedFrameIfPossible(\n // We narrowed this earlier by bailing if `frame.file` is null.\n frame as SourcemappableStackFrame,\n sourceMapCache,\n inspectOptions\n )\n\n if (\n process.env.NODE_ENV !== 'production' &&\n sourcemappedFrame.code !== null &&\n sourceFrameDEV === null &&\n // TODO: Is this the right choice?\n !sourcemappedFrame.stack.ignored\n ) {\n sourceFrameDEV = sourcemappedFrame.code\n }\n if (!sourcemappedFrame.stack.ignored) {\n // TODO: Consider what happens if every frame is ignore listed.\n sourceMappedStack += '\\n' + frameToString(sourcemappedFrame.stack)\n } else if (showIgnoreListed && !inspectOptions.colors) {\n sourceMappedStack += '\\n' + frameToString(sourcemappedFrame.stack)\n } else if (showIgnoreListed) {\n sourceMappedStack += '\\n' + dim(frameToString(sourcemappedFrame.stack))\n }\n }\n }\n\n return (\n errorName +\n ': ' +\n error.message +\n sourceMappedStack +\n (sourceFrameDEV !== null ? '\\n' + sourceFrameDEV : '')\n )\n}\n\nfunction sourceMapError(\n this: void,\n error: Error,\n inspectOptions: util.InspectOptions\n): Error {\n // Create a new Error object with the source mapping applied and then use native\n // Node.js formatting on the result.\n const newError =\n error.cause !== undefined\n ? // Setting an undefined `cause` would print `[cause]: undefined`\n new Error(error.message, { cause: error.cause })\n : new Error(error.message)\n\n // TODO: Ensure `class MyError extends Error {}` prints `MyError` as the name\n newError.stack = parseAndSourceMap(error, inspectOptions)\n\n for (const key in error) {\n if (!Object.prototype.hasOwnProperty.call(newError, key)) {\n // @ts-expect-error -- We're copying all enumerable properties.\n // So they definitely exist on `this` and obviously have no type on `newError` (yet)\n newError[key] = error[key]\n }\n }\n\n return newError\n}\n\nexport function patchErrorInspectNodeJS(\n errorConstructor: ErrorConstructor\n): void {\n const inspectSymbol = Symbol.for('nodejs.util.inspect.custom')\n\n errorConstructor.prepareStackTrace = prepareUnsourcemappedStackTrace\n\n // @ts-expect-error -- TODO upstream types\n // eslint-disable-next-line no-extend-native -- We're not extending but overriding.\n errorConstructor.prototype[inspectSymbol] = function (\n depth: number,\n inspectOptions: util.InspectOptions,\n inspect: typeof util.inspect\n ): string {\n // avoid false-positive dynamic i/o warnings e.g. due to usage of `Math.random` in `source-map`.\n return workUnitAsyncStorage.exit(() => {\n const newError = sourceMapError(this, inspectOptions)\n\n const originalCustomInspect = (newError as any)[inspectSymbol]\n // Prevent infinite recursion.\n // { customInspect: false } would result in `error.cause` not using our inspect.\n Object.defineProperty(newError, inspectSymbol, {\n value: undefined,\n enumerable: false,\n writable: true,\n })\n try {\n return inspect(newError, {\n ...inspectOptions,\n depth:\n (inspectOptions.depth ??\n // Default in Node.js\n 2) - depth,\n })\n } finally {\n ;(newError as any)[inspectSymbol] = originalCustomInspect\n }\n })\n }\n}\n\nexport function patchErrorInspectEdgeLite(\n errorConstructor: ErrorConstructor\n): void {\n const inspectSymbol = Symbol.for('edge-runtime.inspect.custom')\n\n errorConstructor.prepareStackTrace = prepareUnsourcemappedStackTrace\n\n // @ts-expect-error -- TODO upstream types\n // eslint-disable-next-line no-extend-native -- We're not extending but overriding.\n errorConstructor.prototype[inspectSymbol] = function ({\n format,\n }: {\n format: (...args: unknown[]) => string\n }): string {\n // avoid false-positive dynamic i/o warnings e.g. due to usage of `Math.random` in `source-map`.\n return workUnitAsyncStorage.exit(() => {\n const newError = sourceMapError(this, {})\n\n const originalCustomInspect = (newError as any)[inspectSymbol]\n // Prevent infinite recursion.\n Object.defineProperty(newError, inspectSymbol, {\n value: undefined,\n enumerable: false,\n writable: true,\n })\n try {\n return format(newError)\n } finally {\n ;(newError as any)[inspectSymbol] = originalCustomInspect\n }\n })\n }\n}\n"],"names":["patchErrorInspectEdgeLite","patchErrorInspectNodeJS","setBundlerFindSourceMapImplementation","bundlerFindSourceMapPayload","undefined","findSourceMapImplementation","frameToString","frame","sourceLocation","lineNumber","column","fileLocation","file","startsWith","URL","canParse","path","relative","process","cwd","url","fileURLToPath","methodName","computeErrorName","error","name","prepareUnsourcemappedStackTrace","structuredStackTrace","message","stack","i","length","toString","shouldIgnoreListGeneratedFrame","includes","shouldIgnoreListOriginalFrame","findApplicableSourceMapPayload","payload","frameLine","frameColumn","section","sections","offset","line","map","getSourcemappedFrameIfPossible","sourceMapCache","inspectOptions","sourceMapCacheEntry","get","sourceMapConsumer","sourceMapPayload","nativeFindSourceMap","sourceURL","pathToFileURL","maybeSourceMapPayload","arguments","ignored","code","SyncSourceMapConsumer","set","sourcePosition","originalPositionFor","source","sourceContent","sourceContentFor","applicableSourceMap","console","sourceIndex","sources","indexOf","ignoreList","originalFrame","replace","codeFrame","env","NODE_ENV","getOriginalCodeFrame","colors","parseAndSourceMap","showIgnoreListed","unparsedStack","String","errorName","idx","lastIndexOf","slice","unsourcemappedStack","parseStack","Map","sourceMappedStack","sourceFrameDEV","sourcemappedFrame","dim","sourceMapError","newError","cause","Error","key","Object","prototype","hasOwnProperty","call","errorConstructor","inspectSymbol","Symbol","for","prepareStackTrace","depth","inspect","workUnitAsyncStorage","exit","originalCustomInspect","defineProperty","value","enumerable","writable","format"],"mappings":";;;;;;;;;;;;;;;;IAuagBA,yBAAyB;eAAzBA;;IAzCAC,uBAAuB;eAAvBA;;IAvWAC,qCAAqC;eAArCA;;;wBApBT;8DACe;6DACD;2BAEsC;mCAEhC;wBACU;8CACA;4BACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKpB,6CAA6C;AAC7C,iHAAiH;AACjH,8DAA8D;AAC9D,uCAAuC;AACvC,IAAIC,8BAAoD,IAAMC;AAEvD,SAASF,sCACdG,2BAAiD;IAEjDF,8BAA8BE;AAChC;AAmCA,SAASC,cAAcC,KAAiB;IACtC,IAAIC,iBAAiBD,MAAME,UAAU,KAAK,OAAO,CAAC,CAAC,EAAEF,MAAME,UAAU,EAAE,GAAG;IAC1E,IAAIF,MAAMG,MAAM,KAAK,QAAQF,mBAAmB,IAAI;QAClDA,kBAAkB,CAAC,CAAC,EAAED,MAAMG,MAAM,EAAE;IACtC;IAEA,IAAIC;IACJ,IACEJ,MAAMK,IAAI,KAAK,QACfL,MAAMK,IAAI,CAACC,UAAU,CAAC,cACtBC,IAAIC,QAAQ,CAACR,MAAMK,IAAI,GACvB;QACA,2GAA2G;QAC3G,kGAAkG;QAClG,+EAA+E;QAC/E,4DAA4D;QAC5DD,eAAeK,MAAKC,QAAQ,CAACC,QAAQC,GAAG,IAAIC,KAAIC,aAAa,CAACd,MAAMK,IAAI;IAC1E,OAAO,IAAIL,MAAMK,IAAI,KAAK,QAAQL,MAAMK,IAAI,CAACC,UAA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0C;IAC1C,mFAAmF;IACnF6E,iBAAiBH,SAAS,CAACI,cAAc,GAAG,SAC1CI,KAAa,EACb7D,cAAmC,EACnC8D,OAA4B;QAE5B,gGAAgG;QAChG,OAAOC,kDAAoB,CAACC,IAAI,CAAC;YAC/B,MAAMhB,WAAWD,eAAe,IAAI,EAAE/C;YAEtC,MAAMiE,wBAAwB,AAACjB,QAAgB,CAACS,cAAc;YAC9D,8BAA8B;YAC9B,gFAAgF;YAChFL,OAAOc,cAAc,CAAClB,UAAUS,eAAe;gBAC7CU,OAAO9G;gBACP+G,YAAY;gBACZC,UAAU;YACZ;YACA,IAAI;gBACF,OAAOP,QAAQd,UAAU;oBACvB,GAAGhD,cAAc;oBACjB6D,OACE,AAAC7D,CAAAA,eAAe6D,KAAK,IACnB,qBAAqB;oBACrB,CAAA,IAAKA;gBACX;YACF,SAAU;;gBACNb,QAAgB,CAACS,cAAc,GAAGQ;YACtC;QACF;IACF;AACF;AAEO,SAAShH,0BACduG,gBAAkC;IAElC,MAAMC,gBAAgBC,OAAOC,GAAG,CAAC;IAEjCH,iBAAiBI,iBAAiB,GAAGjF;IAErC,0CAA0C;IAC1C,mFAAmF;IACnF6E,iBAAiBH,SAAS,CAACI,cAAc,GAAG,SAAU,EACpDa,MAAM,EAGP;QACC,gGAAgG;QAChG,OAAOP,kDAAoB,CAACC,IAAI,CAAC;YAC/B,MAAMhB,WAAWD,eAAe,IAAI,EAAE,CAAC;YAEvC,MAAMkB,wBAAwB,AAACjB,QAAgB,CAACS,cAAc;YAC9D,8BAA8B;YAC9BL,OAAOc,cAAc,CAAClB,UAAUS,eAAe;gBAC7CU,OAAO9G;gBACP+G,YAAY;gBACZC,UAAU;YACZ;YACA,IAAI;gBACF,OAAOC,OAAOtB;YAChB,SAAU;;gBACNA,QAAgB,CAACS,cAAc,GAAGQ;YACtC;QACF;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/server/patch-error-inspect.ts"],"sourcesContent":["import {\n findSourceMap as nativeFindSourceMap,\n type SourceMapPayload,\n} from 'module'\nimport * as path from 'path'\nimport * as url from 'url'\nimport type * as util from 'util'\nimport { SourceMapConsumer as SyncSourceMapConsumer } from 'next/dist/compiled/source-map'\nimport type { StackFrame } from 'next/dist/compiled/stacktrace-parser'\nimport { parseStack } from '../client/components/react-dev-overlay/server/middleware-webpack'\nimport { getOriginalCodeFrame } from '../client/components/react-dev-overlay/server/shared'\nimport { workUnitAsyncStorage } from './app-render/work-unit-async-storage.external'\nimport { dim } from '../lib/picocolors'\n\ntype FindSourceMapPayload = (\n sourceURL: string\n) => ModernSourceMapPayload | undefined\n// Find a source map using the bundler's API.\n// This is only a fallback for when Node.js fails to due to bugs e.g. https://github.com/nodejs/node/issues/52102\n// TODO: Remove once all supported Node.js versions are fixed.\n// TODO(veil): Set from Webpack as well\nlet bundlerFindSourceMapPayload: FindSourceMapPayload = () => undefined\n\nexport function setBundlerFindSourceMapImplementation(\n findSourceMapImplementation: FindSourceMapPayload\n): void {\n bundlerFindSourceMapPayload = findSourceMapImplementation\n}\n\n/**\n * https://tc39.es/source-map/#index-map\n */\ninterface IndexSourceMapSection {\n offset: {\n line: number\n column: number\n }\n map: ModernRawSourceMap\n}\n\n// TODO(veil): Upstream types\ninterface IndexSourceMap {\n version: number\n file: string\n sections: IndexSourceMapSection[]\n}\n\ninterface ModernRawSourceMap extends SourceMapPayload {\n ignoreList?: number[]\n}\n\nexport type ModernSourceMapPayload = ModernRawSourceMap | IndexSourceMap\n\ninterface IgnoreableStackFrame extends StackFrame {\n ignored: boolean\n}\n\ntype SourceMapCache = Map<\n string,\n { map: SyncSourceMapConsumer; payload: ModernSourceMapPayload }\n>\n\nfunction frameToString(frame: StackFrame): string {\n let sourceLocation = frame.lineNumber !== null ? `:${frame.lineNumber}` : ''\n if (frame.column !== null && sourceLocation !== '') {\n sourceLocation += `:${frame.column}`\n }\n\n let fileLocation: string | null\n if (\n frame.file !== null &&\n frame.file.startsWith('file://') &&\n URL.canParse(frame.file)\n ) {\n // If not relative to CWD, the path is ambiguous to IDEs and clicking will prompt to select the file first.\n // In a multi-app repo, this leads to potentially larger file names but will make clicking snappy.\n // There's no tradeoff for the cases where `dir` in `next dev [dir]` is omitted\n // since relative to cwd is both the shortest and snappiest.\n fileLocation = path.relative(process.cwd(), url.fileURLToPath(frame.file))\n } else if (frame.file !== null && frame.file.startsWith('/')) {\n fileLocation = path.relative(process.cwd(), frame.file)\n } else {\n fileLocation = frame.file\n }\n\n return frame.methodName\n ? ` at ${frame.methodName} (${fileLocation}${sourceLocation})`\n : ` at ${fileLocation}${sourceLocation}`\n}\n\nfunction computeErrorName(error: Error): string {\n // TODO: Node.js seems to use a different algorithm\n // class ReadonlyRequestCookiesError extends Error {}` would read `ReadonlyRequestCookiesError: [...]`\n // in the stack i.e. seems like under certain conditions it favors the constructor name.\n return error.name || 'Error'\n}\n\nfunction prepareUnsourcemappedStackTrace(\n error: Error,\n structuredStackTrace: any[]\n): string {\n const name = computeErrorName(error)\n const message = error.message || ''\n let stack = name + ': ' + message\n for (let i = 0; i < structuredStackTrace.length; i++) {\n stack += '\\n at ' + structuredStackTrace[i].toString()\n }\n return stack\n}\n\nfunction shouldIgnoreListGeneratedFrame(file: string): boolean {\n return file.startsWith('node:') || file.includes('node_modules')\n}\n\nfunction shouldIgnoreListOriginalFrame(file: string): boolean {\n return file.includes('node_modules')\n}\n\n/**\n * Finds the sourcemap payload applicable to a given frame.\n * Equal to the input unless an Index Source Map is used.\n */\nfunction findApplicableSourceMapPayload(\n frame: StackFrame,\n payload: ModernSourceMapPayload\n): ModernRawSourceMap | undefined {\n if ('sections' in payload) {\n const frameLine = frame.lineNumber ?? 0\n const frameColumn = frame.column ?? 0\n // Sections must not overlap and must be sorted: https://tc39.es/source-map/#section-object\n // Therefore the last section that has an offset less than or equal to the frame is the applicable one.\n // TODO(veil): Binary search\n let section: IndexSourceMapSection | undefined = payload.sections[0]\n for (\n let i = 0;\n i < payload.sections.length &&\n payload.sections[i].offset.line <= frameLine &&\n payload.sections[i].offset.column <= frameColumn;\n i++\n ) {\n section = payload.sections[i]\n }\n\n return section === undefined ? undefined : section.map\n } else {\n return payload\n }\n}\n\ninterface SourcemappableStackFrame extends StackFrame {\n file: NonNullable<StackFrame['file']>\n}\n\ninterface SourceMappedFrame {\n stack: IgnoreableStackFrame\n // DEV only\n code: string | null\n}\n\nfunction createUnsourcemappedFrame(\n frame: SourcemappableStackFrame\n): SourceMappedFrame {\n return {\n stack: {\n arguments: frame.arguments,\n column: frame.column,\n file: frame.file,\n lineNumber: frame.lineNumber,\n methodName: frame.methodName,\n ignored: shouldIgnoreListGeneratedFrame(frame.file),\n },\n code: null,\n }\n}\n\n/**\n * @param frame\n * @param sourceMapCache\n * @returns The original frame if not sourcemapped.\n */\nfunction getSourcemappedFrameIfPossible(\n frame: SourcemappableStackFrame,\n sourceMapCache: SourceMapCache,\n inspectOptions: util.InspectOptions\n): {\n stack: IgnoreableStackFrame\n // DEV only\n code: string | null\n} {\n const sourceMapCacheEntry = sourceMapCache.get(frame.file)\n let sourceMapConsumer: SyncSourceMapConsumer\n let sourceMapPayload: ModernSourceMapPayload\n if (sourceMapCacheEntry === undefined) {\n let sourceURL = frame.file\n // e.g. \"/APP/.next/server/chunks/ssr/[root of the server]__2934a0._.js\"\n // will be keyed by Node.js as \"file:///APP/.next/server/chunks/ssr/[root%20of%20the%20server]__2934a0._.js\".\n // This is likely caused by `callsite.toString()` in `Error.prepareStackTrace converting file URLs to paths.\n if (sourceURL.startsWith('/')) {\n sourceURL = url.pathToFileURL(frame.file).toString()\n }\n let maybeSourceMapPayload: ModernSourceMapPayload | undefined\n try {\n const sourceMap = nativeFindSourceMap(sourceURL)\n maybeSourceMapPayload = sourceMap?.payload\n } catch (cause) {\n // We should not log an actual error instance here because that will re-enter\n // this codepath during error inspection and could lead to infinite recursion.\n console.error(\n `${sourceURL}: Invalid source map. Only conformant source maps can be used to find the original code. Cause: ${cause}`\n )\n // Don't even fall back to the bundler because it might be not as strict\n // with regards to parsing and then we fail later once we consume the\n // source map payload.\n // This essentially avoids a redundant error where we fail here and then\n // later on consumption because the bundler just handed back an invalid\n // source map.\n return createUnsourcemappedFrame(frame)\n }\n if (maybeSourceMapPayload === undefined) {\n maybeSourceMapPayload = bundlerFindSourceMapPayload(sourceURL)\n }\n\n if (maybeSourceMapPayload === undefined) {\n return createUnsourcemappedFrame(frame)\n }\n sourceMapPayload = maybeSourceMapPayload\n try {\n sourceMapConsumer = new SyncSourceMapConsumer(\n // @ts-expect-error -- Module.SourceMap['version'] is number but SyncSourceMapConsumer wants a string\n sourceMapPayload\n )\n } catch (cause) {\n // We should not log an actual error instance here because that will re-enter\n // this codepath during error inspection and could lead to infinite recursion.\n console.error(\n `${sourceURL}: Invalid source map. Only conformant source maps can be used to find the original code. Cause: ${cause}`\n )\n return createUnsourcemappedFrame(frame)\n }\n sourceMapCache.set(frame.file, {\n map: sourceMapConsumer,\n payload: sourceMapPayload,\n })\n } else {\n sourceMapConsumer = sourceMapCacheEntry.map\n sourceMapPayload = sourceMapCacheEntry.payload\n }\n\n const sourcePosition = sourceMapConsumer.originalPositionFor({\n column: frame.column ?? 0,\n line: frame.lineNumber ?? 1,\n })\n\n if (sourcePosition.source === null) {\n return {\n stack: {\n arguments: frame.arguments,\n column: frame.column,\n file: frame.file,\n lineNumber: frame.lineNumber,\n methodName: frame.methodName,\n ignored: shouldIgnoreListGeneratedFrame(frame.file),\n },\n code: null,\n }\n }\n\n const sourceContent: string | null =\n sourceMapConsumer.sourceContentFor(\n sourcePosition.source,\n /* returnNullOnMissing */ true\n ) ?? null\n\n const applicableSourceMap = findApplicableSourceMapPayload(\n frame,\n sourceMapPayload\n )\n // TODO(veil): Upstream a method to sourcemap consumer that immediately says if a frame is ignored or not.\n let ignored = false\n if (applicableSourceMap === undefined) {\n console.error('No applicable source map found in sections for frame', frame)\n } else if (shouldIgnoreListOriginalFrame(sourcePosition.source)) {\n // Externals may be libraries that don't ship ignoreLists.\n // This is really taking control away from libraries.\n // They should still ship `ignoreList` so that attached debuggers ignore-list their frames.\n // TODO: Maybe only ignore library sourcemaps if `ignoreList` is absent?\n // Though keep in mind that Turbopack omits empty `ignoreList`.\n // So if we establish this convention, we should communicate it to the ecosystem.\n ignored = true\n } else {\n // TODO: O(n^2). Consider moving `ignoreList` into a Set\n const sourceIndex = applicableSourceMap.sources.indexOf(\n sourcePosition.source\n )\n ignored = applicableSourceMap.ignoreList?.includes(sourceIndex) ?? false\n }\n\n const originalFrame: IgnoreableStackFrame = {\n // We ignore the sourcemapped name since it won't be the correct name.\n // The callsite will point to the column of the variable name instead of the\n // name of the enclosing function.\n // TODO(NDX-531): Spy on prepareStackTrace to get the enclosing line number for method name mapping.\n methodName: frame.methodName\n ?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default')\n ?.replace('__webpack_exports__.', ''),\n column: sourcePosition.column,\n file: sourcePosition.source,\n lineNumber: sourcePosition.line,\n // TODO: c&p from async createOriginalStackFrame but why not frame.arguments?\n arguments: [],\n ignored,\n }\n\n const codeFrame =\n process.env.NODE_ENV !== 'production'\n ? getOriginalCodeFrame(\n originalFrame,\n sourceContent,\n inspectOptions.colors\n )\n : null\n\n return {\n stack: originalFrame,\n code: codeFrame,\n }\n}\n\nfunction parseAndSourceMap(\n error: Error,\n inspectOptions: util.InspectOptions\n): string {\n // TODO(veil): Expose as CLI arg or config option. Useful for local debugging.\n const showIgnoreListed = false\n // We overwrote Error.prepareStackTrace earlier so error.stack is not sourcemapped.\n let unparsedStack = String(error.stack)\n // We could just read it from `error.stack`.\n // This works around cases where a 3rd party `Error.prepareStackTrace` implementation\n // doesn't implement the name computation correctly.\n const errorName = computeErrorName(error)\n\n let idx = unparsedStack.indexOf('react-stack-bottom-frame')\n if (idx !== -1) {\n idx = unparsedStack.lastIndexOf('\\n', idx)\n }\n if (idx !== -1 && !showIgnoreListed) {\n // Cut off everything after the bottom frame since it'll be React internals.\n unparsedStack = unparsedStack.slice(0, idx)\n }\n\n const unsourcemappedStack = parseStack(unparsedStack)\n const sourceMapCache: SourceMapCache = new Map()\n\n let sourceMappedStack = ''\n let sourceFrameDEV: null | string = null\n for (const frame of unsourcemappedStack) {\n if (frame.file === null) {\n sourceMappedStack += '\\n' + frameToString(frame)\n } else {\n const sourcemappedFrame = getSourcemappedFrameIfPossible(\n // We narrowed this earlier by bailing if `frame.file` is null.\n frame as SourcemappableStackFrame,\n sourceMapCache,\n inspectOptions\n )\n\n if (\n process.env.NODE_ENV !== 'production' &&\n sourcemappedFrame.code !== null &&\n sourceFrameDEV === null &&\n // TODO: Is this the right choice?\n !sourcemappedFrame.stack.ignored\n ) {\n sourceFrameDEV = sourcemappedFrame.code\n }\n if (!sourcemappedFrame.stack.ignored) {\n // TODO: Consider what happens if every frame is ignore listed.\n sourceMappedStack += '\\n' + frameToString(sourcemappedFrame.stack)\n } else if (showIgnoreListed && !inspectOptions.colors) {\n sourceMappedStack += '\\n' + frameToString(sourcemappedFrame.stack)\n } else if (showIgnoreListed) {\n sourceMappedStack += '\\n' + dim(frameToString(sourcemappedFrame.stack))\n }\n }\n }\n\n return (\n errorName +\n ': ' +\n error.message +\n sourceMappedStack +\n (sourceFrameDEV !== null ? '\\n' + sourceFrameDEV : '')\n )\n}\n\nfunction sourceMapError(\n this: void,\n error: Error,\n inspectOptions: util.InspectOptions\n): Error {\n // Create a new Error object with the source mapping applied and then use native\n // Node.js formatting on the result.\n const newError =\n error.cause !== undefined\n ? // Setting an undefined `cause` would print `[cause]: undefined`\n new Error(error.message, { cause: error.cause })\n : new Error(error.message)\n\n // TODO: Ensure `class MyError extends Error {}` prints `MyError` as the name\n newError.stack = parseAndSourceMap(error, inspectOptions)\n\n for (const key in error) {\n if (!Object.prototype.hasOwnProperty.call(newError, key)) {\n // @ts-expect-error -- We're copying all enumerable properties.\n // So they definitely exist on `this` and obviously have no type on `newError` (yet)\n newError[key] = error[key]\n }\n }\n\n return newError\n}\n\nexport function patchErrorInspectNodeJS(\n errorConstructor: ErrorConstructor\n): void {\n const inspectSymbol = Symbol.for('nodejs.util.inspect.custom')\n\n errorConstructor.prepareStackTrace = prepareUnsourcemappedStackTrace\n\n // @ts-expect-error -- TODO upstream types\n // eslint-disable-next-line no-extend-native -- We're not extending but overriding.\n errorConstructor.prototype[inspectSymbol] = function (\n depth: number,\n inspectOptions: util.InspectOptions,\n inspect: typeof util.inspect\n ): string {\n // avoid false-positive dynamic i/o warnings e.g. due to usage of `Math.random` in `source-map`.\n return workUnitAsyncStorage.exit(() => {\n const newError = sourceMapError(this, inspectOptions)\n\n const originalCustomInspect = (newError as any)[inspectSymbol]\n // Prevent infinite recursion.\n // { customInspect: false } would result in `error.cause` not using our inspect.\n Object.defineProperty(newError, inspectSymbol, {\n value: undefined,\n enumerable: false,\n writable: true,\n })\n try {\n return inspect(newError, {\n ...inspectOptions,\n depth:\n (inspectOptions.depth ??\n // Default in Node.js\n 2) - depth,\n })\n } finally {\n ;(newError as any)[inspectSymbol] = originalCustomInspect\n }\n })\n }\n}\n\nexport function patchErrorInspectEdgeLite(\n errorConstructor: ErrorConstructor\n): void {\n const inspectSymbol = Symbol.for('edge-runtime.inspect.custom')\n\n errorConstructor.prepareStackTrace = prepareUnsourcemappedStackTrace\n\n // @ts-expect-error -- TODO upstream types\n // eslint-disable-next-line no-extend-native -- We're not extending but overriding.\n errorConstructor.prototype[inspectSymbol] = function ({\n format,\n }: {\n format: (...args: unknown[]) => string\n }): string {\n // avoid false-positive dynamic i/o warnings e.g. due to usage of `Math.random` in `source-map`.\n return workUnitAsyncStorage.exit(() => {\n const newError = sourceMapError(this, {})\n\n const originalCustomInspect = (newError as any)[inspectSymbol]\n // Prevent infinite recursion.\n Object.defineProperty(newError, inspectSymbol, {\n value: undefined,\n enumerable: false,\n writable: true,\n })\n try {\n return format(newError)\n } finally {\n ;(newError as any)[inspectSymbol] = originalCustomInspect\n }\n })\n }\n}\n"],"names":["patchErrorInspectEdgeLite","patchErrorInspectNodeJS","setBundlerFindSourceMapImplementation","bundlerFindSourceMapPayload","undefined","findSourceMapImplementation","frameToString","frame","sourceLocation","lineNumber","column","fileLocation","file","startsWith","URL","canParse","path","relative","process","cwd","url","fileURLToPath","methodName","computeErrorName","error","name","prepareUnsourcemappedStackTrace","structuredStackTrace","message","stack","i","length","toString","shouldIgnoreListGeneratedFrame","includes","shouldIgnoreListOriginalFrame","findApplicableSourceMapPayload","payload","frameLine","frameColumn","section","sections","offset","line","map","createUnsourcemappedFrame","arguments","ignored","code","getSourcemappedFrameIfPossible","sourceMapCache","inspectOptions","sourceMapCacheEntry","get","sourceMapConsumer","sourceMapPayload","sourceURL","pathToFileURL","maybeSourceMapPayload","sourceMap","nativeFindSourceMap","cause","console","SyncSourceMapConsumer","set","sourcePosition","originalPositionFor","source","sourceContent","sourceContentFor","applicableSourceMap","sourceIndex","sources","indexOf","ignoreList","originalFrame","replace","codeFrame","env","NODE_ENV","getOriginalCodeFrame","colors","parseAndSourceMap","showIgnoreListed","unparsedStack","String","errorName","idx","lastIndexOf","slice","unsourcemappedStack","parseStack","Map","sourceMappedStack","sourceFrameDEV","sourcemappedFrame","dim","sourceMapError","newError","Error","key","Object","prototype","hasOwnProperty","call","errorConstructor","inspectSymbol","Symbol","for","prepareStackTrace","depth","inspect","workUnitAsyncStorage","exit","originalCustomInspect","defineProperty","value","enumerable","writable","format"],"mappings":";;;;;;;;;;;;;;;;IA+cgBA,yBAAyB;eAAzBA;;IAzCAC,uBAAuB;eAAvBA;;IA/YAC,qCAAqC;eAArCA;;;wBApBT;8DACe;6DACD;2BAEsC;mCAEhC;wBACU;8CACA;4BACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKpB,6CAA6C;AAC7C,iHAAiH;AACjH,8DAA8D;AAC9D,uCAAuC;AACvC,IAAIC,8BAAoD,IAAMC;AAEvD,SAASF,sCACdG,2BAAiD;IAEjDF,8BAA8BE;AAChC;AAmCA,SAASC,cAAcC,KAAiB;IACtC,IAAIC,iBAAiBD,MAAME,UAAU,KAAK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,EAAE9C;YAEtC,MAAM+D,wBAAwB,AAAChB,QAAgB,CAACQ,cAAc;YAC9D,8BAA8B;YAC9B,gFAAgF;YAChFL,OAAOc,cAAc,CAACjB,UAAUQ,eAAe;gBAC7CU,OAAOhH;gBACPiH,YAAY;gBACZC,UAAU;YACZ;YACA,IAAI;gBACF,OAAOP,QAAQb,UAAU;oBACvB,GAAG/C,cAAc;oBACjB2D,OACE,AAAC3D,CAAAA,eAAe2D,KAAK,IACnB,qBAAqB;oBACrB,CAAA,IAAKA;gBACX;YACF,SAAU;;gBACNZ,QAAgB,CAACQ,cAAc,GAAGQ;YACtC;QACF;IACF;AACF;AAEO,SAASlH,0BACdyG,gBAAkC;IAElC,MAAMC,gBAAgBC,OAAOC,GAAG,CAAC;IAEjCH,iBAAiBI,iBAAiB,GAAGnF;IAErC,0CAA0C;IAC1C,mFAAmF;IACnF+E,iBAAiBH,SAAS,CAACI,cAAc,GAAG,SAAU,EACpDa,MAAM,EAGP;QACC,gGAAgG;QAChG,OAAOP,kDAAoB,CAACC,IAAI,CAAC;YAC/B,MAAMf,WAAWD,eAAe,IAAI,EAAE,CAAC;YAEvC,MAAMiB,wBAAwB,AAAChB,QAAgB,CAACQ,cAAc;YAC9D,8BAA8B;YAC9BL,OAAOc,cAAc,CAACjB,UAAUQ,eAAe;gBAC7CU,OAAOhH;gBACPiH,YAAY;gBACZC,UAAU;YACZ;YACA,IAAI;gBACF,OAAOC,OAAOrB;YAChB,SAAU;;gBACNA,QAAgB,CAACQ,cAAc,GAAGQ;YACtC;QACF;IACF;AACF"}
|
|
@@ -11,11 +11,11 @@ Object.defineProperty(exports, "eventCliSessionStopped", {
|
|
|
11
11
|
const EVENT_VERSION = 'NEXT_CLI_SESSION_STOPPED';
|
|
12
12
|
function eventCliSessionStopped(event) {
|
|
13
13
|
// This should be an invariant, if it fails our build tooling is broken.
|
|
14
|
-
if (typeof "15.2.0-canary.
|
|
14
|
+
if (typeof "15.2.0-canary.48" !== 'string') {
|
|
15
15
|
return [];
|
|
16
16
|
}
|
|
17
17
|
const payload = {
|
|
18
|
-
nextVersion: "15.2.0-canary.
|
|
18
|
+
nextVersion: "15.2.0-canary.48",
|
|
19
19
|
nodeVersion: process.version,
|
|
20
20
|
cliCommand: event.cliCommand,
|
|
21
21
|
durationMilliseconds: event.durationMilliseconds,
|
|
@@ -36,12 +36,12 @@ function hasBabelConfig(dir) {
|
|
|
36
36
|
function eventCliSession(dir, nextConfig, event) {
|
|
37
37
|
var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1, _nextConfig_experimental_reactCompiler, _nextConfig_experimental_reactCompiler1;
|
|
38
38
|
// This should be an invariant, if it fails our build tooling is broken.
|
|
39
|
-
if (typeof "15.2.0-canary.
|
|
39
|
+
if (typeof "15.2.0-canary.48" !== 'string') {
|
|
40
40
|
return [];
|
|
41
41
|
}
|
|
42
42
|
const { images, i18n } = nextConfig || {};
|
|
43
43
|
const payload = {
|
|
44
|
-
nextVersion: "15.2.0-canary.
|
|
44
|
+
nextVersion: "15.2.0-canary.48",
|
|
45
45
|
nodeVersion: process.version,
|
|
46
46
|
cliCommand: event.cliCommand,
|
|
47
47
|
isSrcDir: event.isSrcDir,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next",
|
|
3
|
-
"version": "15.2.0-canary.
|
|
3
|
+
"version": "15.2.0-canary.48",
|
|
4
4
|
"description": "The React Framework",
|
|
5
5
|
"main": "./dist/server/next.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
]
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@next/env": "15.2.0-canary.
|
|
103
|
+
"@next/env": "15.2.0-canary.48",
|
|
104
104
|
"@swc/counter": "0.1.3",
|
|
105
105
|
"@swc/helpers": "0.5.15",
|
|
106
106
|
"busboy": "1.6.0",
|
|
@@ -132,14 +132,14 @@
|
|
|
132
132
|
},
|
|
133
133
|
"optionalDependencies": {
|
|
134
134
|
"sharp": "^0.33.5",
|
|
135
|
-
"@next/swc-darwin-arm64": "15.2.0-canary.
|
|
136
|
-
"@next/swc-darwin-x64": "15.2.0-canary.
|
|
137
|
-
"@next/swc-linux-arm64-gnu": "15.2.0-canary.
|
|
138
|
-
"@next/swc-linux-arm64-musl": "15.2.0-canary.
|
|
139
|
-
"@next/swc-linux-x64-gnu": "15.2.0-canary.
|
|
140
|
-
"@next/swc-linux-x64-musl": "15.2.0-canary.
|
|
141
|
-
"@next/swc-win32-arm64-msvc": "15.2.0-canary.
|
|
142
|
-
"@next/swc-win32-x64-msvc": "15.2.0-canary.
|
|
135
|
+
"@next/swc-darwin-arm64": "15.2.0-canary.48",
|
|
136
|
+
"@next/swc-darwin-x64": "15.2.0-canary.48",
|
|
137
|
+
"@next/swc-linux-arm64-gnu": "15.2.0-canary.48",
|
|
138
|
+
"@next/swc-linux-arm64-musl": "15.2.0-canary.48",
|
|
139
|
+
"@next/swc-linux-x64-gnu": "15.2.0-canary.48",
|
|
140
|
+
"@next/swc-linux-x64-musl": "15.2.0-canary.48",
|
|
141
|
+
"@next/swc-win32-arm64-msvc": "15.2.0-canary.48",
|
|
142
|
+
"@next/swc-win32-x64-msvc": "15.2.0-canary.48"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
145
|
"@ampproject/toolbox-optimizer": "2.8.3",
|
|
@@ -172,11 +172,11 @@
|
|
|
172
172
|
"@jest/types": "29.5.0",
|
|
173
173
|
"@mswjs/interceptors": "0.23.0",
|
|
174
174
|
"@napi-rs/triples": "1.2.0",
|
|
175
|
-
"@next/font": "15.2.0-canary.
|
|
176
|
-
"@next/polyfill-module": "15.2.0-canary.
|
|
177
|
-
"@next/polyfill-nomodule": "15.2.0-canary.
|
|
178
|
-
"@next/react-refresh-utils": "15.2.0-canary.
|
|
179
|
-
"@next/swc": "15.2.0-canary.
|
|
175
|
+
"@next/font": "15.2.0-canary.48",
|
|
176
|
+
"@next/polyfill-module": "15.2.0-canary.48",
|
|
177
|
+
"@next/polyfill-nomodule": "15.2.0-canary.48",
|
|
178
|
+
"@next/react-refresh-utils": "15.2.0-canary.48",
|
|
179
|
+
"@next/swc": "15.2.0-canary.48",
|
|
180
180
|
"@opentelemetry/api": "1.6.0",
|
|
181
181
|
"@playwright/test": "1.41.2",
|
|
182
182
|
"@storybook/addon-a11y": "8.5.2",
|