From 5608f19a4d4bcf202fbd7df8d5b7dd7d4e4f2b3f Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Wed, 16 Jul 2025 15:36:37 +0200 Subject: [PATCH 01/13] [lint] keep lint-stage use faster linting (#81710) --- lint-staged.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lint-staged.config.js b/lint-staged.config.js index e8852786545f5..f9df6a963b932 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,7 +1,7 @@ module.exports = { '*.{js,jsx,mjs,ts,tsx,mts,mdx}': [ 'prettier --with-node-modules --ignore-path .prettierignore --write', - 'cross-env ESLINT_USE_FLAT_CONFIG=false eslint --config .eslintrc.cli.json --no-eslintrc --fix', + 'cross-env ESLINT_USE_FLAT_CONFIG=false eslint --config .eslintrc.json --no-eslintrc --fix', ], '*.{json,md,css,html,yml,yaml,scss}': [ 'prettier --with-node-modules --ignore-path .prettierignore --write', From a3f031d834af6da4640a6f33ab6fb86d87df442c Mon Sep 17 00:00:00 2001 From: Janka Uryga Date: Wed, 16 Jul 2025 16:23:34 +0200 Subject: [PATCH 02/13] fix: rootParams should throw in client when fallbackParams are not present (#81711) `rootParams` was erroring if used in a `'prerender-client'`, but only if we had `fallbackRouteParams`. this is an edge case, but it is technically possible to hit if our compiler checks for using `rootParams` in client code are bypassed. i've also had to split `PrerenderStoreModern` into two types instead of having `type: 'prerender' | 'prerender-client'`. otherwise, typescript would think that the `case 'prerender'` branch wasn't enough to eliminate `PrerenderStoreModern` even though we already handled the `prerender-client` case at the top. this made the `prerenderStore satisfies never` assertion at the bottom fail. This is a bit tricky to explain, so i'm including a [TS playground repro](https://www.typescriptlang.org/play/?#code/C4TwDgpgBAysD2AnCAZCBzAhgYxFAvFAN5SiQBcUA5GMsgHYAmEiAtADYY4hUC+AUGWhwkEALLxmiegWKlwESjToQmLKlAA+1Wi1VTW2dgEtVwDQKGwEyWSORosuLddESp9fvwgAPMEmAoADMAV3psYGN4GQBnFgA3FgB5enYQABUAC2N6dAAKGJtFV2QASkpCxBz0Yn4oeqhjIKgCooA6K3wunRU1NiNTenNS2oax0kzEeAB3KHoIWYBRRCnEPKoAOXhAzHZ2GYhGRpkBsypSuoaBMZjp42BsTJbC0Q6FEaJL8agAeh+obCYOI9PR9QwmM5fcZ-KAAPSgAGFMPQqIFGPAJsYYlBMnooJgsDkADRQdIwKAsVbYu7AJ4AA3SCmoACJdAwDKchsyNFi5tsAfAALZgTCITAAI04pAxViorN6Bk4ThAzJc8tBUm5bTpULGMLy4oggJCwOm0EeRoA1ocJphAoagqIAIQXXUNQHA5Qa9SUT7fb7IYAhaRQZkAdQgVFsOXxUEFkhYMjZ+hYzLd9Wu-o90C97JYHC4uCovvT40DwZk4cj0ZkmCgSu4UGTfTT-qgme+zCCmBC7GAJbbNyKUBidqxQVM2PmiUQpb1-1hAH45w0YW11+KQoEyZj6JbsXSXsg6QDkSPInsoIbY-ZxAmQ7jbBBEjJafAQugnmaqIkKSZBTkdo2uK2xPP4MQxMYkrmkCEDYqWHbtvwAhAA) i'm guessing that `type: 'prerender' | 'prerender-client'` is more complex than a normal discriminator and TS was getting confused, which is why having two separate types solves it. --- .../work-unit-async-storage.external.ts | 17 ++++++++++++----- .../next/src/server/request/root-params.ts | 18 +++++++++++++----- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/packages/next/src/server/app-render/work-unit-async-storage.external.ts b/packages/next/src/server/app-render/work-unit-async-storage.external.ts index 98baaefdcf70a..5ffc35c648c1e 100644 --- a/packages/next/src/server/app-render/work-unit-async-storage.external.ts +++ b/packages/next/src/server/app-render/work-unit-async-storage.external.ts @@ -78,12 +78,19 @@ export interface RequestStore extends CommonWorkUnitStore { * only needs to happen during the RSC prerender when we are prospectively prerendering * to fill all caches. */ -export interface PrerenderStoreModern extends CommonWorkUnitStore { - // In the future the prerender-client variant will get it's own type. - // prerender represents the RSC scope of the prerender. - // prerender-client represents the HTML scope of the prerender. - type: 'prerender' | 'prerender-client' +export type PrerenderStoreModern = + | PrerenderStoreModernClient + | PrerenderStoreModernServer +interface PrerenderStoreModernClient extends PrerenderStoreModernCommon { + type: 'prerender-client' +} + +interface PrerenderStoreModernServer extends PrerenderStoreModernCommon { + type: 'prerender' +} + +interface PrerenderStoreModernCommon extends CommonWorkUnitStore { /** * This signal is aborted when the React render is complete. (i.e. it is the same signal passed to react) */ diff --git a/packages/next/src/server/request/root-params.ts b/packages/next/src/server/request/root-params.ts index 32c53a050b2a3..21d8fdacd3ca0 100644 --- a/packages/next/src/server/request/root-params.ts +++ b/packages/next/src/server/request/root-params.ts @@ -66,6 +66,19 @@ function createPrerenderRootParams( workStore: WorkStore, prerenderStore: PrerenderStore ): Promise { + switch (prerenderStore.type) { + case 'prerender-client': { + const exportName = '`unstable_rootParams`' + throw new InvariantError( + `${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.` + ) + } + case 'prerender': + case 'prerender-legacy': + case 'prerender-ppr': + default: + } + const fallbackParams = workStore.fallbackRouteParams if (fallbackParams) { let hasSomeFallbackParams = false @@ -93,11 +106,6 @@ function createPrerenderRootParams( CachedParams.set(underlyingParams, promise) return promise - case 'prerender-client': - const exportName = '`unstable_rootParams`' - throw new InvariantError( - `${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.` - ) case 'prerender-ppr': case 'prerender-legacy': // We aren't in a dynamicIO prerender but we do have fallback params at this From c3e6680bfd245d840d479ba3ba1d0b1a570a19b1 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Wed, 16 Jul 2025 08:49:40 -0600 Subject: [PATCH 03/13] perf(build): optimize buildAppStaticPaths performance and add helper function (#81386) ### What? Optimizes the `buildAppStaticPaths` function performance and extracts a helper function `calculateFallbackMode` to reduce code duplication. ### Why? The `buildAppStaticPaths` function had several performance bottlenecks: 1. **Repeated regex pattern compilation**: Route parameter patterns were being compiled inside the loop for every route, causing unnecessary overhead 2. **Inefficient root parameter lookups**: Using `Array.includes()` for root parameter checks resulted in O(n) lookups for each parameter 3. **Duplicated fallback mode logic**: The same fallback mode calculation was repeated in multiple places, making the code harder to maintain and prone to inconsistencies These inefficiencies became more apparent when processing large numbers of routes with complex parameter structures. ### How? **Performance optimizations:** - Pre-compile regex patterns for route parameters outside the loop and store them in a Map for O(1) lookups - Convert `rootParamKeys` to a Set for O(1) lookup time instead of O(n) array searches - Optimize the fallback parameter collection loop to break early and avoid redundant iterations **Code organization:** - Extract `calculateFallbackMode` helper function to eliminate code duplication - Add comprehensive tests for the new helper function to ensure correctness - Simplify the main loop logic by using the pre-compiled patterns and optimized data structures --- .../next/src/build/static-paths/app.test.ts | 113 ++++++++-- packages/next/src/build/static-paths/app.ts | 204 ++++++++++-------- 2 files changed, 207 insertions(+), 110 deletions(-) diff --git a/packages/next/src/build/static-paths/app.test.ts b/packages/next/src/build/static-paths/app.test.ts index 40da5dfa07a97..88b5806d7a7d6 100644 --- a/packages/next/src/build/static-paths/app.test.ts +++ b/packages/next/src/build/static-paths/app.test.ts @@ -2,7 +2,8 @@ import { FallbackMode } from '../../lib/fallback' import type { Params } from '../../server/request/params' import { assignErrorIfEmpty, - generateParamPrefixCombinations, + generateAllParamCombinations, + calculateFallbackMode, filterUniqueParams, generateRouteStaticParams, } from './app' @@ -356,7 +357,7 @@ describe('generateParamPrefixCombinations', () => { { id: '2', name: 'test' }, ] - const unique = generateParamPrefixCombinations(['id'], params, []) + const unique = generateAllParamCombinations(['id'], params, []) expect(unique).toEqual([{ id: '1' }, { id: '2' }]) }) @@ -369,11 +370,7 @@ describe('generateParamPrefixCombinations', () => { { lang: 'fr', region: 'CA', page: 'about' }, ] - const unique = generateParamPrefixCombinations( - ['lang', 'region'], - params, - [] - ) + const unique = generateAllParamCombinations(['lang', 'region'], params, []) expect(unique).toEqual([ { lang: 'en' }, @@ -386,20 +383,20 @@ describe('generateParamPrefixCombinations', () => { it('should handle parameter value collisions', () => { const params = [{ slug: ['foo', 'bar'] }, { slug: 'foo,bar' }] - const unique = generateParamPrefixCombinations(['slug'], params, []) + const unique = generateAllParamCombinations(['slug'], params, []) expect(unique).toEqual([{ slug: ['foo', 'bar'] }, { slug: 'foo,bar' }]) }) it('should handle empty inputs', () => { // Empty routeParamKeys - expect(generateParamPrefixCombinations([], [{ id: '1' }], [])).toEqual([]) + expect(generateAllParamCombinations([], [{ id: '1' }], [])).toEqual([]) // Empty routeParams - expect(generateParamPrefixCombinations(['id'], [], [])).toEqual([]) + expect(generateAllParamCombinations(['id'], [], [])).toEqual([]) // Both empty - expect(generateParamPrefixCombinations([], [], [])).toEqual([]) + expect(generateAllParamCombinations([], [], [])).toEqual([]) }) it('should handle undefined parameters', () => { @@ -409,7 +406,7 @@ describe('generateParamPrefixCombinations', () => { { id: '3' }, // missing name key ] - const unique = generateParamPrefixCombinations(['id', 'name'], params, []) + const unique = generateAllParamCombinations(['id', 'name'], params, []) expect(unique).toEqual([ { id: '1' }, @@ -426,7 +423,7 @@ describe('generateParamPrefixCombinations', () => { { lang: 'fr' }, // missing region and category ] - const unique = generateParamPrefixCombinations( + const unique = generateAllParamCombinations( ['lang', 'region', 'category'], params, [] @@ -450,7 +447,7 @@ describe('generateParamPrefixCombinations', () => { { slug: 'U:undefined' }, // String that looks like undefined prefix ] - const unique = generateParamPrefixCombinations(['slug'], params, []) + const unique = generateAllParamCombinations(['slug'], params, []) expect(unique).toEqual([ { slug: ['foo', 'bar'] }, @@ -468,7 +465,7 @@ describe('generateParamPrefixCombinations', () => { { slug: ['foo', 'bar|baz'] }, // Array with pipe in element ] - const unique = generateParamPrefixCombinations(['slug'], params, []) + const unique = generateAllParamCombinations(['slug'], params, []) expect(unique).toEqual([{ slug: 'foo|bar' }, { slug: ['foo', 'bar|baz'] }]) }) @@ -480,7 +477,7 @@ describe('generateParamPrefixCombinations', () => { { a: '1', b: '2', c: '3', d: '7' }, ] - const unique = generateParamPrefixCombinations( + const unique = generateAllParamCombinations( ['a', 'b', 'c', 'd', 'e'], params, [] @@ -505,7 +502,7 @@ describe('generateParamPrefixCombinations', () => { { lang: 'fr', region: 'CA', slug: 'about' }, ] - const unique = generateParamPrefixCombinations( + const unique = generateAllParamCombinations( ['lang', 'region', 'slug'], params, ['lang', 'region'] // Root params @@ -529,7 +526,7 @@ describe('generateParamPrefixCombinations', () => { { category: 'sports', slug: 'news' }, ] - const unique = generateParamPrefixCombinations( + const unique = generateAllParamCombinations( ['category', 'slug'], params, [] // No root params @@ -552,7 +549,7 @@ describe('generateParamPrefixCombinations', () => { { lang: 'fr', page: 'home' }, ] - const unique = generateParamPrefixCombinations( + const unique = generateAllParamCombinations( ['lang', 'page'], params, ['lang'] // Single root param @@ -575,7 +572,7 @@ describe('generateParamPrefixCombinations', () => { { page: 'contact' }, // Missing lang root param ] - const unique = generateParamPrefixCombinations( + const unique = generateAllParamCombinations( ['lang', 'page'], params, ['lang'] // Root param @@ -596,7 +593,7 @@ describe('generateParamPrefixCombinations', () => { { category: 'sports', slug: 'news' }, ] - const unique = generateParamPrefixCombinations( + const unique = generateAllParamCombinations( ['category', 'slug'], params, ['lang', 'region'] // Root params not in route params @@ -620,7 +617,7 @@ describe('generateParamPrefixCombinations', () => { { lang: 'en', locale: 'us' }, // Missing slug parameter ] - const unique = generateParamPrefixCombinations( + const unique = generateAllParamCombinations( ['lang', 'locale', 'slug'], // All route params params, ['lang', 'locale'] // Root params @@ -637,7 +634,7 @@ describe('generateParamPrefixCombinations', () => { // This might be what's happening for the [slug] route const params: Params[] = [] // No generateStaticParams results - const unique = generateParamPrefixCombinations( + const unique = generateAllParamCombinations( ['lang', 'locale', 'slug'], // All route params params, ['lang', 'locale'] // Root params @@ -1027,3 +1024,73 @@ describe('generateRouteStaticParams', () => { }) }) }) + +describe('calculateFallbackMode', () => { + it('should return NOT_FOUND when dynamic params are disabled', () => { + const result = calculateFallbackMode(false, [], FallbackMode.PRERENDER) + + expect(result).toBe(FallbackMode.NOT_FOUND) + }) + + it('should return NOT_FOUND when dynamic params are disabled regardless of root params', () => { + const result = calculateFallbackMode( + false, + ['rootParam'], + FallbackMode.BLOCKING_STATIC_RENDER + ) + + expect(result).toBe(FallbackMode.NOT_FOUND) + }) + + it('should return BLOCKING_STATIC_RENDER when dynamic params are enabled and root params exist', () => { + const result = calculateFallbackMode( + true, + ['rootParam1', 'rootParam2'], + FallbackMode.PRERENDER + ) + + expect(result).toBe(FallbackMode.BLOCKING_STATIC_RENDER) + }) + + it('should return base fallback mode when dynamic params are enabled and no root params', () => { + const result = calculateFallbackMode(true, [], FallbackMode.PRERENDER) + + expect(result).toBe(FallbackMode.PRERENDER) + }) + + it('should return base fallback mode when dynamic params are enabled and empty root params', () => { + const result = calculateFallbackMode( + true, + [], + FallbackMode.BLOCKING_STATIC_RENDER + ) + + expect(result).toBe(FallbackMode.BLOCKING_STATIC_RENDER) + }) + + it('should return NOT_FOUND when dynamic params are enabled but no base fallback mode provided', () => { + const result = calculateFallbackMode(true, [], undefined) + + expect(result).toBe(FallbackMode.NOT_FOUND) + }) + + it('should prioritize root params over base fallback mode', () => { + const result = calculateFallbackMode( + true, + ['rootParam'], + FallbackMode.PRERENDER + ) + + expect(result).toBe(FallbackMode.BLOCKING_STATIC_RENDER) + }) + + it('should handle single root param correctly', () => { + const result = calculateFallbackMode( + true, + ['singleParam'], + FallbackMode.PRERENDER + ) + + expect(result).toBe(FallbackMode.BLOCKING_STATIC_RENDER) + }) +}) diff --git a/packages/next/src/build/static-paths/app.ts b/packages/next/src/build/static-paths/app.ts index 70d41f4d9f270..94be2a22e594b 100644 --- a/packages/next/src/build/static-paths/app.ts +++ b/packages/next/src/build/static-paths/app.ts @@ -76,17 +76,17 @@ export function filterUniqueParams( } /** - * Generates all unique sub-combinations of route params from a list of parameters. - * This function creates all possible prefixes of the route parameters, which is - * useful for generating partial routes that can serve as shells for more specific routes. + * Generates all unique sub-combinations of Route Parameters from a list of Static Parameters. + * This function creates all possible prefixes of the Route Parameters, which is + * useful for generating Static Shells that can serve as Fallback Shells for more specific Route Shells. * - * When rootParamKeys are provided, the function ensures that partial shells only - * include complete sets of root params. This prevents generating invalid partial - * routes that are missing required root parameters. + * When Root Parameters are provided, the function ensures that Static Shells only + * include complete sets of Root Parameters. This prevents generating invalid Static Shells + * that are missing required Root Parameters. * - * Example with root params ('lang', 'region') and route params ('lang', 'region', 'slug'): + * Example with Root Parameters ('lang', 'region') and Route Parameters ('lang', 'region', 'slug'): * - * Given the following routeParams: + * Given the following Static Parameters: * ``` * [ * { lang: 'en', region: 'US', slug: ['home'] }, @@ -98,41 +98,41 @@ export function filterUniqueParams( * The result will be: * ``` * [ - * { lang: 'en', region: 'US' }, // Complete root params + * { lang: 'en', region: 'US' }, // Complete Root Parameters * { lang: 'en', region: 'US', slug: ['home'] }, * { lang: 'en', region: 'US', slug: ['about'] }, - * { lang: 'fr', region: 'CA' }, // Complete root params + * { lang: 'fr', region: 'CA' }, // Complete Root Parameters * { lang: 'fr', region: 'CA', slug: ['about'] }, * ] * ``` * * Note that partial combinations like `{ lang: 'en' }` are NOT generated because - * they don't include the complete set of root params. + * they don't include the complete set of Root Parameters. * - * For routes without root params (e.g., `/[slug]`), all sub-combinations are generated + * For routes without Root Parameters (e.g., `/[slug]`), all sub-combinations are generated * as before. * - * @param routeParamKeys - The keys of the route params. These should be sorted + * @param routeParamKeys - The keys of the Route Parameters. These should be sorted * to ensure consistent key generation for the internal Map. - * @param routeParams - The list of parameter objects to filter. - * @param rootParamKeys - The keys of the root params. When provided, ensures partial - * shells include all root params. - * @returns A new array containing all unique sub-combinations of route params. + * @param routeParams - The list of Static Parameters to filter. + * @param rootParamKeys - The keys of the Root Parameters. When provided, ensures Static Shells + * include all Root Parameters. + * @returns A new array containing all unique sub-combinations of Route Parameters. */ -export function generateParamPrefixCombinations( +export function generateAllParamCombinations( routeParamKeys: readonly string[], routeParams: readonly Params[], rootParamKeys: readonly string[] ): Params[] { - // A Map is used to store unique combinations of route parameters. - // The key of the Map is a string representation of the route parameter + // A Map is used to store unique combinations of Route Parameters. + // The key of the Map is a string representation of the Route Parameter // combination, and the value is the `Params` object containing only - // the route parameters. + // the Route Parameters. const combinations = new Map() - // Determine the minimum index where all root params are included. + // Determine the minimum index where all Root Parameters are included. // This optimization ensures we only generate combinations that include - // a complete set of root parameters, preventing invalid partial shells. + // a complete set of Root Parameters, preventing invalid Static Shells. // // For example, if rootParamKeys = ['lang', 'region'] and routeParamKeys = ['lang', 'region', 'slug']: // - 'lang' is at index 0, 'region' is at index 1 @@ -140,19 +140,19 @@ export function generateParamPrefixCombinations( // - We'll only generate combinations starting from index 1 (which includes both lang and region) let minIndexForCompleteRootParams = -1 if (rootParamKeys.length > 0) { - // Find the index of the last root param in routeParamKeys. - // This tells us the minimum combination length needed to include all root params. + // Find the index of the last Root Parameter in routeParamKeys. + // This tells us the minimum combination length needed to include all Root Parameters. for (const rootParamKey of rootParamKeys) { const index = routeParamKeys.indexOf(rootParamKey) if (index === -1) { - // Root param not found in route params - this shouldn't happen in normal cases - // but we handle it gracefully by treating it as if there are no root params. + // Root Parameter not found in Route Parameters - this shouldn't happen in normal cases + // but we handle it gracefully by treating it as if there are no Root Parameters. // This allows the function to fall back to generating all sub-combinations. minIndexForCompleteRootParams = -1 break } - // Track the highest index among all root params. - // This ensures all root params are included in any generated combination. + // Track the highest index among all Root Parameters. + // This ensures all Root Parameters are included in any generated combination. minIndexForCompleteRootParams = Math.max( minIndexForCompleteRootParams, index @@ -160,22 +160,22 @@ export function generateParamPrefixCombinations( } } - // Iterate over each parameter object in the input array. + // Iterate over each Static Parameter object in the input array. // Each params object represents one potential route combination (e.g., { lang: 'en', region: 'US', slug: 'home' }) for (const params of routeParams) { - // Generate all possible prefix combinations for this parameter set. + // Generate all possible prefix combinations for this Static Parameter set. // For routeParamKeys = ['lang', 'region', 'slug'], we'll generate combinations at: // - i=0: { lang: 'en' } // - i=1: { lang: 'en', region: 'US' } // - i=2: { lang: 'en', region: 'US', slug: 'home' } // // The iteration order is crucial for generating stable and unique keys - // for each route parameter combination. + // for each Route Parameter combination. for (let i = 0; i < routeParamKeys.length; i++) { - // Skip generating combinations that don't include all root params. - // This prevents creating invalid partial shells that are missing required root parameters. + // Skip generating combinations that don't include all Root Parameters. + // This prevents creating invalid Static Shells that are missing required Root Parameters. // - // For example, if root params are ['lang', 'region'] and minIndexForCompleteRootParams = 1: + // For example, if Root Parameters are ['lang', 'region'] and minIndexForCompleteRootParams = 1: // - Skip i=0 (would only include 'lang', missing 'region') // - Process i=1 and higher (includes both 'lang' and 'region') if ( @@ -207,8 +207,8 @@ export function generateParamPrefixCombinations( !params.hasOwnProperty(routeKey) || params[routeKey] === undefined ) { - // If this missing parameter is a root param, mark the combination as invalid. - // Root params are required for PPR shells, so we can't generate partial combinations without them. + // If this missing parameter is a Root Parameter, mark the combination as invalid. + // Root Parameters are required for Static Shells, so we can't generate partial combinations without them. if (rootParamKeys.includes(routeKey)) { hasAllRootParams = false } @@ -243,10 +243,10 @@ export function generateParamPrefixCombinations( const currentKey = keyParts.join('|') // Only add the combination if it meets our criteria: - // 1. hasAllRequiredParams: Contains all required root parameters + // 1. hasAllRootParams: Contains all required Root Parameters // 2. !combinations.has(currentKey): Is not a duplicate of an existing combination // - // This ensures we only generate valid, unique parameter combinations for PPR shells. + // This ensures we only generate valid, unique parameter combinations for Static Shells. if (hasAllRootParams && !combinations.has(currentKey)) { combinations.set(currentKey, combination) } @@ -259,6 +259,28 @@ export function generateParamPrefixCombinations( return Array.from(combinations.values()) } +/** + * Calculates the fallback mode based on the given parameters. + * + * @param dynamicParams - Whether dynamic params are enabled. + * @param fallbackRootParams - The root params that are part of the fallback. + * @param baseFallbackMode - The base fallback mode to use. + * @returns The calculated fallback mode. + */ +export function calculateFallbackMode( + dynamicParams: boolean, + fallbackRootParams: readonly string[], + baseFallbackMode: FallbackMode | undefined +): FallbackMode { + return dynamicParams + ? // If the fallback params includes any root params, then we need to + // perform a blocking static render. + fallbackRootParams.length > 0 + ? FallbackMode.BLOCKING_STATIC_RENDER + : baseFallbackMode ?? FallbackMode.NOT_FOUND + : FallbackMode.NOT_FOUND +} + /** * Validates the parameters to ensure they're accessible and have the correct * types. @@ -755,33 +777,46 @@ export async function buildAppStaticPaths({ const prerenderedRoutesByPathname = new Map() + // Precompile the regex patterns for the route params. + const paramPatterns = new Map() + for (const key of routeParamKeys) { + const { repeat, optional } = regex.groups[key] + let pattern = `[${repeat ? '...' : ''}${key}]` + if (optional) { + pattern = `[${pattern}]` + } + paramPatterns.set(key, pattern) + } + + // Convert rootParamKeys to Set for O(1) lookup. + const rootParamSet = new Set(rootParamKeys) + if (hadAllParamsGenerated || isRoutePPREnabled) { + let paramsToProcess = routeParams + if (isRoutePPREnabled) { // Discover all unique combinations of the routeParams so we can generate // routes that won't throw on empty static shell for each of them if // they're available. - routeParams.unshift( - ...generateParamPrefixCombinations( - routeParamKeys, - routeParams, - rootParamKeys - ) + paramsToProcess = generateAllParamCombinations( + routeParamKeys, + routeParams, + rootParamKeys ) + // Add the base route, this is the route with all the placeholders as it's + // derived from the `page` string. prerenderedRoutesByPathname.set(page, { params: {}, pathname: page, encodedPathname: page, fallbackRouteParams: routeParamKeys, - fallbackMode: dynamicParams - ? // If the fallback params includes any root params, then we need to - // perform a blocking static render. - rootParamKeys.length > 0 - ? FallbackMode.BLOCKING_STATIC_RENDER - : fallbackMode - : FallbackMode.NOT_FOUND, + fallbackMode: calculateFallbackMode( + dynamicParams, + rootParamKeys, + fallbackMode + ), fallbackRootParams: rootParamKeys, - // This is set later after all the routes have been processed. throwOnEmptyStaticShell: true, }) } @@ -794,30 +829,29 @@ export async function buildAppStaticPaths({ isRoutePPREnabled, routeParamKeys, rootParamKeys, - routeParams + paramsToProcess ) ).forEach((params) => { - let pathname: string = page - let encodedPathname: string = page + let pathname = page + let encodedPathname = page - let fallbackRouteParams: string[] = [] + const fallbackRouteParams: string[] = [] for (const key of routeParamKeys) { - if (fallbackRouteParams.length > 0) { - // This is a partial route, so we should add the value to the - // fallbackRouteParams. - fallbackRouteParams.push(key) - continue - } - - let paramValue = params[key] + const paramValue = params[key] if (!paramValue) { if (isRoutePPREnabled) { - // This is a partial route, so we should add the value to the - // fallbackRouteParams. + // Mark remaining params as fallback params. fallbackRouteParams.push(key) - continue + for ( + let i = routeParamKeys.indexOf(key) + 1; + i < routeParamKeys.length; + i++ + ) { + fallbackRouteParams.push(routeParamKeys[i]) + } + break } else { // This route is not complete, and we aren't performing a partial // prerender, so we should return, skipping this route. @@ -825,25 +859,24 @@ export async function buildAppStaticPaths({ } } - const { repeat, optional } = regex.groups[key] - let replaced = `[${repeat ? '...' : ''}${key}]` - if (optional) { - replaced = `[${replaced}]` - } - + // Use pre-compiled pattern for replacement + const pattern = paramPatterns.get(key)! pathname = pathname.replace( - replaced, + pattern, encodeParam(paramValue, (value) => escapePathDelimiters(value, true)) ) encodedPathname = encodedPathname.replace( - replaced, + pattern, encodeParam(paramValue, encodeURIComponent) ) } - const fallbackRootParams = rootParamKeys.filter((param) => - fallbackRouteParams.includes(param) - ) + const fallbackRootParams: string[] = [] + for (const param of fallbackRouteParams) { + if (rootParamSet.has(param)) { + fallbackRootParams.push(param) + } + } pathname = normalizePathname(pathname) @@ -852,15 +885,12 @@ export async function buildAppStaticPaths({ pathname, encodedPathname: normalizePathname(encodedPathname), fallbackRouteParams, - fallbackMode: dynamicParams - ? // If the fallback params includes any root params, then we need to - // perform a blocking static render. - fallbackRootParams.length > 0 - ? FallbackMode.BLOCKING_STATIC_RENDER - : fallbackMode - : FallbackMode.NOT_FOUND, + fallbackMode: calculateFallbackMode( + dynamicParams, + fallbackRootParams, + fallbackMode + ), fallbackRootParams, - // This is set later after all the routes have been processed. throwOnEmptyStaticShell: true, }) }) From 115eff7201191fcc1d2f10bbc4c69f5359897311 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Wed, 16 Jul 2025 17:05:23 +0200 Subject: [PATCH 04/13] Turbopack: Support string without options for @next/mdx (#81713) ## What? Adds support for `remarkPlugins: ['remark-gfm']` and `rehypePlugins: ['rehype-slug']`. Previously you had to nest an array like `remarkPlugins: [['remark-gfm']]` but that's a bug, that case is only for passing options. Directly passing the string without options should be allowed. This PR implements that. --- docs/01-app/02-guides/mdx.mdx | 16 +++++++++++--- packages/next-mdx/index.d.ts | 17 ++++++++++++++- packages/next-mdx/mdx-js-loader.js | 21 ++++++++++++------- .../app-dir/mdx/app/remark-plugin/page.mdx | 10 +++++++++ test/e2e/app-dir/mdx/mdx.test.ts | 19 +++++++++++++++-- .../mdx/{next.config.mjs => next.config.ts} | 7 +++++-- 6 files changed, 75 insertions(+), 15 deletions(-) create mode 100644 test/e2e/app-dir/mdx/app/remark-plugin/page.mdx rename test/e2e/app-dir/mdx/{next.config.mjs => next.config.ts} (63%) diff --git a/docs/01-app/02-guides/mdx.mdx b/docs/01-app/02-guides/mdx.mdx index c33e4e30b7d46..44e5eeb831213 100644 --- a/docs/01-app/02-guides/mdx.mdx +++ b/docs/01-app/02-guides/mdx.mdx @@ -727,8 +727,18 @@ const nextConfig = { const withMDX = createMDX({ options: { - remarkPlugins: [], - rehypePlugins: [['rehype-katex', { strict: true, throwOnError: true }]], + remarkPlugins: [ + // Without options + 'remark-gfm', + // With options + ['remark-toc', { heading: 'The Table' }], + ], + rehypePlugins: [ + // Without options + 'rehype-slug', + // With options + ['rehype-katex', { strict: true, throwOnError: true }], + ], }, }) @@ -737,7 +747,7 @@ export default withMDX(nextConfig) > **Good to know**: > -> remark and rehype plugins without serializable options cannot be used yet with [Turbopack](/docs/app/api-reference/turbopack), due to [inability to pass JavaScript functions to Rust](https://github.com/vercel/next.js/issues/71819#issuecomment-2461802968) +> remark and rehype plugins without serializable options cannot be used yet with [Turbopack](/docs/app/api-reference/turbopack), because JavaScript functions can't be passed to Rust. ## Remote MDX diff --git a/packages/next-mdx/index.d.ts b/packages/next-mdx/index.d.ts index 4d86a74e83563..5460628456ebf 100644 --- a/packages/next-mdx/index.d.ts +++ b/packages/next-mdx/index.d.ts @@ -21,7 +21,22 @@ declare namespace nextMDX { * * @see https://mdxjs.com/packages/mdx/#api */ - options?: Options + options?: Options & { + remarkPlugins?: + | ( + | string + | [name: string, options: any] + | NonNullable[number] + )[] + | Options['remarkPlugins'] + rehypePlugins?: + | ( + | string + | [name: string, options: any] + | NonNullable[number] + )[] + | Options['rehypePlugins'] + } } } diff --git a/packages/next-mdx/mdx-js-loader.js b/packages/next-mdx/mdx-js-loader.js index 84ab6dd4b50db..1182c6ed5e7a7 100644 --- a/packages/next-mdx/mdx-js-loader.js +++ b/packages/next-mdx/mdx-js-loader.js @@ -5,15 +5,22 @@ function interopDefault(mod) { return mod.default || mod } +async function importPluginForPath(pluginPath, projectRoot) { + const path = require.resolve(pluginPath, { paths: [projectRoot] }) + return interopDefault( + // "use pathToFileUrl to make esm import()s work with absolute windows paths": + // on windows import("C:\\path\\to\\file") is not valid, so we need to use file:// URLs + // https://github.com/vercel/next.js/commit/fbf9e12de095e0237d4ba4aa6139d9757bd20be9 + await import(process.platform === 'win32' ? pathToFileURL(path) : path) + ) +} + async function importPlugin(plugin, projectRoot) { if (Array.isArray(plugin) && typeof plugin[0] === 'string') { - const path = require.resolve(plugin[0], { paths: [projectRoot] }) - plugin[0] = interopDefault( - // "use pathToFileUrl to make esm import()s work with absolute windows paths": - // on windows import("C:\\path\\to\\file") is not valid, so we need to use file:// URLs - // https://github.com/vercel/next.js/commit/fbf9e12de095e0237d4ba4aa6139d9757bd20be9 - await import(process.platform === 'win32' ? pathToFileURL(path) : path) - ) + plugin[0] = await importPluginForPath(plugin[0], projectRoot) + } + if (typeof plugin === 'string') { + plugin = await importPluginForPath(plugin, projectRoot) } return plugin } diff --git a/test/e2e/app-dir/mdx/app/remark-plugin/page.mdx b/test/e2e/app-dir/mdx/app/remark-plugin/page.mdx new file mode 100644 index 0000000000000..d56857b0b4fd6 --- /dev/null +++ b/test/e2e/app-dir/mdx/app/remark-plugin/page.mdx @@ -0,0 +1,10 @@ +# The Table + +# Remark plugin + +Testing emoji: :dog: :+1: + +## Todo List + +- [ ] Implement +- [x] Implemented diff --git a/test/e2e/app-dir/mdx/mdx.test.ts b/test/e2e/app-dir/mdx/mdx.test.ts index 3e1afbca60428..f65ce80f06523 100644 --- a/test/e2e/app-dir/mdx/mdx.test.ts +++ b/test/e2e/app-dir/mdx/mdx.test.ts @@ -9,6 +9,9 @@ for (const type of ['with-mdx-rs', 'without-mdx-rs']) { '@mdx-js/loader': '^2.2.1', '@mdx-js/react': '^2.2.1', 'rehype-katex': '7.0.1', + 'rehype-slug': '6.0.0', + 'remark-gfm': '4.0.1', + 'remark-toc': '9.0.0', }, env: { WITH_MDX_RS: type === 'with-mdx-rs' ? 'true' : 'false', @@ -62,10 +65,22 @@ for (const type of ['with-mdx-rs', 'without-mdx-rs']) { }) if (type === 'without-mdx-rs') { - it('should run plugins', async () => { - const html = await next.render('/rehype-plugin') + it('should run rehype plugins', async () => { + const $ = await next.render$('/rehype-plugin') + const html = $('html').html() expect(html.includes('C')).toBe(true) expect(html.includes('L')).toBe(true) + expect($('#rehype-plugin').text()).toBe('Rehype plugin') + }) + + it('should run remark plugins', async () => { + const $ = await next.render$('/remark-plugin') + const html = $('html').html() + expect(html.includes('The Table')).toBe(true) + expect($('a[href="#todo-list"]').text()).toBe('Todo List') + + expect($('input[type="checkbox"]').length).toBe(2) + expect($('input[type="checkbox"][checked]').length).toBe(1) }) } }) diff --git a/test/e2e/app-dir/mdx/next.config.mjs b/test/e2e/app-dir/mdx/next.config.ts similarity index 63% rename from test/e2e/app-dir/mdx/next.config.mjs rename to test/e2e/app-dir/mdx/next.config.ts index f56317a7cadf4..5781c14215243 100644 --- a/test/e2e/app-dir/mdx/next.config.mjs +++ b/test/e2e/app-dir/mdx/next.config.ts @@ -2,8 +2,11 @@ import nextMDX from '@next/mdx' const withMDX = nextMDX({ extension: /\.mdx?$/, options: { - remarkPlugins: [], - rehypePlugins: [['rehype-katex', { strict: true, throwOnError: true }]], + remarkPlugins: ['remark-gfm', ['remark-toc', { heading: 'The Table' }]], + rehypePlugins: [ + 'rehype-slug', + ['rehype-katex', { strict: true, throwOnError: true }], + ], }, }) From 9088ece15f42ff5e11df5ef164fb307494a36e74 Mon Sep 17 00:00:00 2001 From: nextjs-bot Date: Wed, 16 Jul 2025 15:08:57 +0000 Subject: [PATCH 05/13] v15.4.2-canary.2 --- lerna.json | 2 +- packages/create-next-app/package.json | 2 +- packages/eslint-config-next/package.json | 4 ++-- packages/eslint-plugin-internal/package.json | 2 +- packages/eslint-plugin-next/package.json | 2 +- packages/font/package.json | 2 +- packages/next-bundle-analyzer/package.json | 2 +- packages/next-codemod/package.json | 2 +- packages/next-env/package.json | 2 +- packages/next-mdx/package.json | 2 +- packages/next-plugin-storybook/package.json | 2 +- packages/next-polyfill-module/package.json | 2 +- packages/next-polyfill-nomodule/package.json | 2 +- packages/next-rspack/package.json | 2 +- packages/next-swc/package.json | 2 +- packages/next/package.json | 14 +++++++------- packages/react-refresh-utils/package.json | 2 +- packages/third-parties/package.json | 4 ++-- pnpm-lock.yaml | 16 ++++++++-------- 19 files changed, 34 insertions(+), 34 deletions(-) diff --git a/lerna.json b/lerna.json index 92c30073bd0bc..822174513cb02 100644 --- a/lerna.json +++ b/lerna.json @@ -16,5 +16,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "15.4.2-canary.1" + "version": "15.4.2-canary.2" } diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index e91c90354f14f..1dfabbe163ac2 100644 --- a/packages/create-next-app/package.json +++ b/packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "keywords": [ "react", "next", diff --git a/packages/eslint-config-next/package.json b/packages/eslint-config-next/package.json index c2580bcca4393..02af0ee6bddb7 100644 --- a/packages/eslint-config-next/package.json +++ b/packages/eslint-config-next/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-next", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "description": "ESLint configuration used by Next.js.", "main": "index.js", "license": "MIT", @@ -10,7 +10,7 @@ }, "homepage": "https://nextjs.org/docs/app/api-reference/config/eslint", "dependencies": { - "@next/eslint-plugin-next": "15.4.2-canary.1", + "@next/eslint-plugin-next": "15.4.2-canary.2", "@rushstack/eslint-patch": "^1.10.3", "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 048d043493ab5..7bf10654a34f9 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -1,7 +1,7 @@ { "name": "@next/eslint-plugin-internal", "private": true, - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "description": "ESLint plugin for working on Next.js.", "exports": { ".": "./src/eslint-plugin-internal.js" diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json index b15ca284ae81c..f126efc2a3afc 100644 --- a/packages/eslint-plugin-next/package.json +++ b/packages/eslint-plugin-next/package.json @@ -1,6 +1,6 @@ { "name": "@next/eslint-plugin-next", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "description": "ESLint plugin for Next.js.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/font/package.json b/packages/font/package.json index 36e6261d7496f..826339f91d578 100644 --- a/packages/font/package.json +++ b/packages/font/package.json @@ -1,7 +1,7 @@ { "name": "@next/font", "private": true, - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "repository": { "url": "vercel/next.js", "directory": "packages/font" diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json index 834bd82643f57..1bbd41110af63 100644 --- a/packages/next-bundle-analyzer/package.json +++ b/packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "main": "index.js", "types": "index.d.ts", "license": "MIT", diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index 53b0aec934e07..eff90fe1732c8 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "license": "MIT", "repository": { "type": "git", diff --git a/packages/next-env/package.json b/packages/next-env/package.json index bd7885d2d114b..ae3842f8c9ba8 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "keywords": [ "react", "next", diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index a628bf5563b18..1bbed7e6ae75c 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-plugin-storybook/package.json b/packages/next-plugin-storybook/package.json index 1f93ec496ce38..5214c3289ead9 100644 --- a/packages/next-plugin-storybook/package.json +++ b/packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-storybook" diff --git a/packages/next-polyfill-module/package.json b/packages/next-polyfill-module/package.json index b5922c4593ff5..4a5612b95fd81 100644 --- a/packages/next-polyfill-module/package.json +++ b/packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)", "main": "dist/polyfill-module.js", "license": "MIT", diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json index 3dbd8eab19cd2..65250cdc4803c 100644 --- a/packages/next-polyfill-nomodule/package.json +++ b/packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next-rspack/package.json b/packages/next-rspack/package.json index 5ab20ba9d4f5f..6ae192bc5d05a 100644 --- a/packages/next-rspack/package.json +++ b/packages/next-rspack/package.json @@ -1,6 +1,6 @@ { "name": "next-rspack", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "repository": { "url": "vercel/next.js", "directory": "packages/next-rspack" diff --git a/packages/next-swc/package.json b/packages/next-swc/package.json index 69dd49796eed1..da2568117b866 100644 --- a/packages/next-swc/package.json +++ b/packages/next-swc/package.json @@ -1,6 +1,6 @@ { "name": "@next/swc", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "private": true, "files": [ "native/" diff --git a/packages/next/package.json b/packages/next/package.json index 727205af7b6ee..cf823e7d78fad 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -100,7 +100,7 @@ ] }, "dependencies": { - "@next/env": "15.4.2-canary.1", + "@next/env": "15.4.2-canary.2", "@swc/helpers": "0.5.15", "caniuse-lite": "^1.0.30001579", "postcss": "8.4.31", @@ -163,11 +163,11 @@ "@jest/types": "29.5.0", "@mswjs/interceptors": "0.23.0", "@napi-rs/triples": "1.2.0", - "@next/font": "15.4.2-canary.1", - "@next/polyfill-module": "15.4.2-canary.1", - "@next/polyfill-nomodule": "15.4.2-canary.1", - "@next/react-refresh-utils": "15.4.2-canary.1", - "@next/swc": "15.4.2-canary.1", + "@next/font": "15.4.2-canary.2", + "@next/polyfill-module": "15.4.2-canary.2", + "@next/polyfill-nomodule": "15.4.2-canary.2", + "@next/react-refresh-utils": "15.4.2-canary.2", + "@next/swc": "15.4.2-canary.2", "@opentelemetry/api": "1.6.0", "@playwright/test": "1.51.1", "@rspack/core": "1.4.5", diff --git a/packages/react-refresh-utils/package.json b/packages/react-refresh-utils/package.json index 36266be8868d4..c848547536c0f 100644 --- a/packages/react-refresh-utils/package.json +++ b/packages/react-refresh-utils/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-refresh-utils", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", diff --git a/packages/third-parties/package.json b/packages/third-parties/package.json index 9ac4b897f7479..41186a2e4ebcc 100644 --- a/packages/third-parties/package.json +++ b/packages/third-parties/package.json @@ -1,6 +1,6 @@ { "name": "@next/third-parties", - "version": "15.4.2-canary.1", + "version": "15.4.2-canary.2", "repository": { "url": "vercel/next.js", "directory": "packages/third-parties" @@ -26,7 +26,7 @@ "third-party-capital": "1.0.20" }, "devDependencies": { - "next": "15.4.2-canary.1", + "next": "15.4.2-canary.2", "outdent": "0.8.0", "prettier": "2.5.1", "typescript": "5.8.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f767bf376970e..4f43455c211d8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -854,7 +854,7 @@ importers: packages/eslint-config-next: dependencies: '@next/eslint-plugin-next': - specifier: 15.4.2-canary.1 + specifier: 15.4.2-canary.2 version: link:../eslint-plugin-next '@rushstack/eslint-patch': specifier: ^1.10.3 @@ -924,7 +924,7 @@ importers: packages/next: dependencies: '@next/env': - specifier: 15.4.2-canary.1 + specifier: 15.4.2-canary.2 version: link:../next-env '@swc/helpers': specifier: 0.5.15 @@ -1046,19 +1046,19 @@ importers: specifier: 1.2.0 version: 1.2.0 '@next/font': - specifier: 15.4.2-canary.1 + specifier: 15.4.2-canary.2 version: link:../font '@next/polyfill-module': - specifier: 15.4.2-canary.1 + specifier: 15.4.2-canary.2 version: link:../next-polyfill-module '@next/polyfill-nomodule': - specifier: 15.4.2-canary.1 + specifier: 15.4.2-canary.2 version: link:../next-polyfill-nomodule '@next/react-refresh-utils': - specifier: 15.4.2-canary.1 + specifier: 15.4.2-canary.2 version: link:../react-refresh-utils '@next/swc': - specifier: 15.4.2-canary.1 + specifier: 15.4.2-canary.2 version: link:../next-swc '@opentelemetry/api': specifier: 1.6.0 @@ -1758,7 +1758,7 @@ importers: version: 1.0.20 devDependencies: next: - specifier: 15.4.2-canary.1 + specifier: 15.4.2-canary.2 version: link:../next outdent: specifier: 0.8.0 From 10ce117bdf5d702969fd81ec15d539be4dfa24cd Mon Sep 17 00:00:00 2001 From: "Sebastian \"Sebbie\" Silbermann" Date: Wed, 16 Jul 2025 18:02:53 +0200 Subject: [PATCH 06/13] [test] Fix `app-static` deploy test (#81712) --- .../e2e/app-dir/app-static/app-static.test.ts | 58 +++++++++++++------ .../app-page/page.tsx | 2 +- .../route-handler/route.ts | 2 +- .../app/stale-cache-serving/app-page/page.tsx | 2 +- .../route-handler/route.ts | 2 +- 5 files changed, 45 insertions(+), 21 deletions(-) diff --git a/test/e2e/app-dir/app-static/app-static.test.ts b/test/e2e/app-dir/app-static/app-static.test.ts index e2f05fd405593..8e81f823064cf 100644 --- a/test/e2e/app-dir/app-static/app-static.test.ts +++ b/test/e2e/app-dir/app-static/app-static.test.ts @@ -2763,27 +2763,51 @@ describe('app-dir static/dynamic handling', () => { for (let i = 0; i < 6; i++) { await waitFor(1000) - const timings = { - start: Date.now(), - startedStreaming: 0, - } - res = await next.fetch(path) - // eslint-disable-next-line no-loop-func - await new Promise((resolve) => { - res.body.on('data', () => { - if (!timings.startedStreaming) { - timings.startedStreaming = Date.now() - } - }) - - res.body.on('end', () => { - resolve() - }) + let data: any + let startedStreaming: number = -1 + res.body.on('data', () => { + if (startedStreaming === -1) { + startedStreaming = Date.now() + } }) + if (res.headers.get('content-type').includes('application/json')) { + data = await res.json() + } else { + const html = await res.text() + const $ = cheerio.load(html) + const dataJSON = $('#data').text() + try { + data = JSON.parse(dataJSON) + } catch (cause) { + throw new Error( + `Failed to parse JSON from data-start attribute: "${dataJSON}"`, + { cause } + ) + } + } - expect(timings.startedStreaming - timings.start).toBeLessThan(3000) + const startedResponding = +data.start + if (Number.isNaN(startedResponding)) { + throw new Error( + `Expected start to be a number. Received: "${data.start}"` + ) + } + if (startedStreaming === -1) { + throw new Error( + 'Expected startedStreaming to be set. This is a bug in the test.' + ) + } + + // We just want to ensure the response isn't blocked on revalidating the fetch. + // So we use the start time when route started processing not when we + // send off the response because that includes cold boots of the infra. + if (startedStreaming - startedResponding >= 3000) { + throw new Error( + `Response #${i} took too long to complete: ${startedStreaming - startedResponding}ms` + ) + } } }) diff --git a/test/e2e/app-dir/app-static/app/stale-cache-serving-edge/app-page/page.tsx b/test/e2e/app-dir/app-static/app/stale-cache-serving-edge/app-page/page.tsx index 8c38f4a80ce95..26cc7baea90b3 100644 --- a/test/e2e/app-dir/app-static/app/stale-cache-serving-edge/app-page/page.tsx +++ b/test/e2e/app-dir/app-static/app/stale-cache-serving-edge/app-page/page.tsx @@ -13,7 +13,7 @@ export default async function Page(props) { return ( <>

- {JSON.stringify({ fetchDuration, data, now: Date.now() })} + {JSON.stringify({ fetchDuration, data, now: Date.now(), start })}

) diff --git a/test/e2e/app-dir/app-static/app/stale-cache-serving-edge/route-handler/route.ts b/test/e2e/app-dir/app-static/app/stale-cache-serving-edge/route-handler/route.ts index 908c1d1727c7b..30b7952b82348 100644 --- a/test/e2e/app-dir/app-static/app/stale-cache-serving-edge/route-handler/route.ts +++ b/test/e2e/app-dir/app-static/app/stale-cache-serving-edge/route-handler/route.ts @@ -12,5 +12,5 @@ export async function GET(req: NextRequest) { ).then((res) => res.json()) const fetchDuration = Date.now() - start - return NextResponse.json({ fetchDuration, data, now: Date.now() }) + return NextResponse.json({ fetchDuration, data, now: Date.now(), start }) } diff --git a/test/e2e/app-dir/app-static/app/stale-cache-serving/app-page/page.tsx b/test/e2e/app-dir/app-static/app/stale-cache-serving/app-page/page.tsx index 44163265365b2..d373e37aa2a31 100644 --- a/test/e2e/app-dir/app-static/app/stale-cache-serving/app-page/page.tsx +++ b/test/e2e/app-dir/app-static/app/stale-cache-serving/app-page/page.tsx @@ -13,7 +13,7 @@ export default async function Page(props) { return ( <>

- {JSON.stringify({ fetchDuration, data, now: Date.now() })} + {JSON.stringify({ fetchDuration, data, now: Date.now(), start })}

) diff --git a/test/e2e/app-dir/app-static/app/stale-cache-serving/route-handler/route.ts b/test/e2e/app-dir/app-static/app/stale-cache-serving/route-handler/route.ts index ba280534db054..408959da737f9 100644 --- a/test/e2e/app-dir/app-static/app/stale-cache-serving/route-handler/route.ts +++ b/test/e2e/app-dir/app-static/app/stale-cache-serving/route-handler/route.ts @@ -12,5 +12,5 @@ export async function GET(req: NextRequest) { ).then((res) => res.json()) const fetchDuration = Date.now() - start - return NextResponse.json({ fetchDuration, data, now: Date.now() }) + return NextResponse.json({ fetchDuration, data, now: Date.now(), start }) } From 6f88000f0bce63bb447de2b6843883043347e84a Mon Sep 17 00:00:00 2001 From: nextjs-bot Date: Wed, 16 Jul 2025 16:06:17 +0000 Subject: [PATCH 07/13] v15.4.2-canary.3 --- lerna.json | 2 +- packages/create-next-app/package.json | 2 +- packages/eslint-config-next/package.json | 4 ++-- packages/eslint-plugin-internal/package.json | 2 +- packages/eslint-plugin-next/package.json | 2 +- packages/font/package.json | 2 +- packages/next-bundle-analyzer/package.json | 2 +- packages/next-codemod/package.json | 2 +- packages/next-env/package.json | 2 +- packages/next-mdx/package.json | 2 +- packages/next-plugin-storybook/package.json | 2 +- packages/next-polyfill-module/package.json | 2 +- packages/next-polyfill-nomodule/package.json | 2 +- packages/next-rspack/package.json | 2 +- packages/next-swc/package.json | 2 +- packages/next/package.json | 14 +++++++------- packages/react-refresh-utils/package.json | 2 +- packages/third-parties/package.json | 4 ++-- pnpm-lock.yaml | 16 ++++++++-------- 19 files changed, 34 insertions(+), 34 deletions(-) diff --git a/lerna.json b/lerna.json index 822174513cb02..8e41bfbfc5cf7 100644 --- a/lerna.json +++ b/lerna.json @@ -16,5 +16,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "15.4.2-canary.2" + "version": "15.4.2-canary.3" } diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index 1dfabbe163ac2..92b4d80b520df 100644 --- a/packages/create-next-app/package.json +++ b/packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "keywords": [ "react", "next", diff --git a/packages/eslint-config-next/package.json b/packages/eslint-config-next/package.json index 02af0ee6bddb7..9798362d069c1 100644 --- a/packages/eslint-config-next/package.json +++ b/packages/eslint-config-next/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-next", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "description": "ESLint configuration used by Next.js.", "main": "index.js", "license": "MIT", @@ -10,7 +10,7 @@ }, "homepage": "https://nextjs.org/docs/app/api-reference/config/eslint", "dependencies": { - "@next/eslint-plugin-next": "15.4.2-canary.2", + "@next/eslint-plugin-next": "15.4.2-canary.3", "@rushstack/eslint-patch": "^1.10.3", "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 7bf10654a34f9..d095c5636dccb 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -1,7 +1,7 @@ { "name": "@next/eslint-plugin-internal", "private": true, - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "description": "ESLint plugin for working on Next.js.", "exports": { ".": "./src/eslint-plugin-internal.js" diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json index f126efc2a3afc..4bb417e5432c3 100644 --- a/packages/eslint-plugin-next/package.json +++ b/packages/eslint-plugin-next/package.json @@ -1,6 +1,6 @@ { "name": "@next/eslint-plugin-next", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "description": "ESLint plugin for Next.js.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/font/package.json b/packages/font/package.json index 826339f91d578..f2a8d22066192 100644 --- a/packages/font/package.json +++ b/packages/font/package.json @@ -1,7 +1,7 @@ { "name": "@next/font", "private": true, - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "repository": { "url": "vercel/next.js", "directory": "packages/font" diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json index 1bbd41110af63..301ed217534eb 100644 --- a/packages/next-bundle-analyzer/package.json +++ b/packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "main": "index.js", "types": "index.d.ts", "license": "MIT", diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index eff90fe1732c8..52f2a25f204e8 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "license": "MIT", "repository": { "type": "git", diff --git a/packages/next-env/package.json b/packages/next-env/package.json index ae3842f8c9ba8..f5270b4f8c38b 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "keywords": [ "react", "next", diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index 1bbed7e6ae75c..112029e77f20d 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-plugin-storybook/package.json b/packages/next-plugin-storybook/package.json index 5214c3289ead9..55904e97b4d4b 100644 --- a/packages/next-plugin-storybook/package.json +++ b/packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-storybook" diff --git a/packages/next-polyfill-module/package.json b/packages/next-polyfill-module/package.json index 4a5612b95fd81..1ea52e1f2de7c 100644 --- a/packages/next-polyfill-module/package.json +++ b/packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)", "main": "dist/polyfill-module.js", "license": "MIT", diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json index 65250cdc4803c..2f94126a6b2d8 100644 --- a/packages/next-polyfill-nomodule/package.json +++ b/packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next-rspack/package.json b/packages/next-rspack/package.json index 6ae192bc5d05a..38ca84cf5133e 100644 --- a/packages/next-rspack/package.json +++ b/packages/next-rspack/package.json @@ -1,6 +1,6 @@ { "name": "next-rspack", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "repository": { "url": "vercel/next.js", "directory": "packages/next-rspack" diff --git a/packages/next-swc/package.json b/packages/next-swc/package.json index da2568117b866..e176784ee60dd 100644 --- a/packages/next-swc/package.json +++ b/packages/next-swc/package.json @@ -1,6 +1,6 @@ { "name": "@next/swc", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "private": true, "files": [ "native/" diff --git a/packages/next/package.json b/packages/next/package.json index cf823e7d78fad..92892e124d3e3 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -100,7 +100,7 @@ ] }, "dependencies": { - "@next/env": "15.4.2-canary.2", + "@next/env": "15.4.2-canary.3", "@swc/helpers": "0.5.15", "caniuse-lite": "^1.0.30001579", "postcss": "8.4.31", @@ -163,11 +163,11 @@ "@jest/types": "29.5.0", "@mswjs/interceptors": "0.23.0", "@napi-rs/triples": "1.2.0", - "@next/font": "15.4.2-canary.2", - "@next/polyfill-module": "15.4.2-canary.2", - "@next/polyfill-nomodule": "15.4.2-canary.2", - "@next/react-refresh-utils": "15.4.2-canary.2", - "@next/swc": "15.4.2-canary.2", + "@next/font": "15.4.2-canary.3", + "@next/polyfill-module": "15.4.2-canary.3", + "@next/polyfill-nomodule": "15.4.2-canary.3", + "@next/react-refresh-utils": "15.4.2-canary.3", + "@next/swc": "15.4.2-canary.3", "@opentelemetry/api": "1.6.0", "@playwright/test": "1.51.1", "@rspack/core": "1.4.5", diff --git a/packages/react-refresh-utils/package.json b/packages/react-refresh-utils/package.json index c848547536c0f..84c8617a7d3b8 100644 --- a/packages/react-refresh-utils/package.json +++ b/packages/react-refresh-utils/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-refresh-utils", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", diff --git a/packages/third-parties/package.json b/packages/third-parties/package.json index 41186a2e4ebcc..a06029a910004 100644 --- a/packages/third-parties/package.json +++ b/packages/third-parties/package.json @@ -1,6 +1,6 @@ { "name": "@next/third-parties", - "version": "15.4.2-canary.2", + "version": "15.4.2-canary.3", "repository": { "url": "vercel/next.js", "directory": "packages/third-parties" @@ -26,7 +26,7 @@ "third-party-capital": "1.0.20" }, "devDependencies": { - "next": "15.4.2-canary.2", + "next": "15.4.2-canary.3", "outdent": "0.8.0", "prettier": "2.5.1", "typescript": "5.8.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4f43455c211d8..b9eb08f4c92a5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -854,7 +854,7 @@ importers: packages/eslint-config-next: dependencies: '@next/eslint-plugin-next': - specifier: 15.4.2-canary.2 + specifier: 15.4.2-canary.3 version: link:../eslint-plugin-next '@rushstack/eslint-patch': specifier: ^1.10.3 @@ -924,7 +924,7 @@ importers: packages/next: dependencies: '@next/env': - specifier: 15.4.2-canary.2 + specifier: 15.4.2-canary.3 version: link:../next-env '@swc/helpers': specifier: 0.5.15 @@ -1046,19 +1046,19 @@ importers: specifier: 1.2.0 version: 1.2.0 '@next/font': - specifier: 15.4.2-canary.2 + specifier: 15.4.2-canary.3 version: link:../font '@next/polyfill-module': - specifier: 15.4.2-canary.2 + specifier: 15.4.2-canary.3 version: link:../next-polyfill-module '@next/polyfill-nomodule': - specifier: 15.4.2-canary.2 + specifier: 15.4.2-canary.3 version: link:../next-polyfill-nomodule '@next/react-refresh-utils': - specifier: 15.4.2-canary.2 + specifier: 15.4.2-canary.3 version: link:../react-refresh-utils '@next/swc': - specifier: 15.4.2-canary.2 + specifier: 15.4.2-canary.3 version: link:../next-swc '@opentelemetry/api': specifier: 1.6.0 @@ -1758,7 +1758,7 @@ importers: version: 1.0.20 devDependencies: next: - specifier: 15.4.2-canary.2 + specifier: 15.4.2-canary.3 version: link:../next outdent: specifier: 0.8.0 From 964d0634cd5f8782cfbac145865c7e0f3f414b70 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Wed, 16 Jul 2025 11:12:58 -0500 Subject: [PATCH 08/13] Fix: createRouterAct "reject" config (#81720) Fixes a problem with the internal `createRouterAct` testing helper where the `block: "reject"` option would not error correctly, leading to potential false negatives. I think I accidentally broke this when I added the ability to provide an array of expected responses. --- test/e2e/app-dir/segment-cache/router-act.ts | 32 ++++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/test/e2e/app-dir/segment-cache/router-act.ts b/test/e2e/app-dir/segment-cache/router-act.ts index cb35b8952a66c..779050902e548 100644 --- a/test/e2e/app-dir/segment-cache/router-act.ts +++ b/test/e2e/app-dir/segment-cache/router-act.ts @@ -72,6 +72,7 @@ export function createRouterAct( } let expectedResponses: Array | null + let forbiddenResponses: Array | null = null let shouldBlockAll = false if (config === undefined || config === null) { // Default. Expect at least one request, but don't assert on the response. @@ -101,6 +102,7 @@ export function createRouterAct( expectedResponses = [config] } else { expectedResponses = [] + forbiddenResponses = [config] } } else { expectedResponses = [] @@ -113,6 +115,12 @@ export function createRouterAct( } if (item.block !== 'reject') { expectedResponses.push(item) + } else { + if (forbiddenResponses === null) { + forbiddenResponses = [item] + } else { + forbiddenResponses.push(item) + } } } } @@ -288,14 +296,11 @@ ${fulfilled.body} ` throw error } - if (expectedResponses !== null) { - let alreadyMatchedByThisResponse: string | null = null - for (const expectedResponse of expectedResponses) { - const includes = expectedResponse.includes - const block = expectedResponse.block + if (forbiddenResponses !== null) { + for (const forbiddenResponse of forbiddenResponses) { + const includes = forbiddenResponse.includes if (fulfilled.body.includes(includes)) { - if (block === 'reject') { - error.message = ` + error.message = ` Received a response containing an unexpected substring: Rejected substring: ${includes} @@ -303,9 +308,16 @@ Rejected substring: ${includes} Response: ${fulfilled.body} ` - throw error - } - + throw error + } + } + } + if (expectedResponses !== null) { + let alreadyMatchedByThisResponse: string | null = null + for (const expectedResponse of expectedResponses) { + const includes = expectedResponse.includes + const block = expectedResponse.block + if (fulfilled.body.includes(includes)) { // Match. Don't check yet whether the responses are received // in the expected order. Instead collect all the matches and // check at the end so we can include a diff in the From f74a1697a919ec222c3950190ddd09519432baf3 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Wed, 16 Jul 2025 11:13:54 -0500 Subject: [PATCH 09/13] [Segment Cache] Support dynamic head prefetching (#81677) Fixes an issue where opting into dynamic prefetching with prefetch={true} would not apply to head data (like the title), only the page data. Although the head was being sent by the server as part of the prefetch response, it wasn't being transferred correctly to the prefetch cache. The net result is that you can now fully prefetch a page with a dynamic title without any additional network requests on navigation. --- .../components/segment-cache-impl/cache.ts | 38 +++++++++++++++---- .../incremental-opt-in/app/page.tsx | 8 ++++ .../app/ppr-disabled-dynamic-head/page.tsx | 27 +++++++++++++ .../segment-cache-incremental-opt-in.test.ts | 37 ++++++++++++++++++ 4 files changed, 102 insertions(+), 8 deletions(-) create mode 100644 test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-dynamic-head/page.tsx diff --git a/packages/next/src/client/components/segment-cache-impl/cache.ts b/packages/next/src/client/components/segment-cache-impl/cache.ts index 39373cba8da2e..16efe06352b5e 100644 --- a/packages/next/src/client/components/segment-cache-impl/cache.ts +++ b/packages/next/src/client/components/segment-cache-impl/cache.ts @@ -1534,6 +1534,16 @@ function writeDynamicRenderResponseIntoCache( // TODO: We should cache this, too, so that the MPA navigation is immediate. return null } + + const staleTimeHeaderSeconds = response.headers.get( + NEXT_ROUTER_STALE_TIME_HEADER + ) + const staleTimeMs = + staleTimeHeaderSeconds !== null + ? parseInt(staleTimeHeaderSeconds, 10) * 1000 + : STATIC_STALETIME_MS + const staleAt = now + staleTimeMs + for (const flightData of flightDatas) { const seedData = flightData.seedData if (seedData !== null) { @@ -1555,24 +1565,36 @@ function writeDynamicRenderResponseIntoCache( encodeSegment(segment) ) } - const staleTimeHeaderSeconds = response.headers.get( - NEXT_ROUTER_STALE_TIME_HEADER - ) - const staleTimeMs = - staleTimeHeaderSeconds !== null - ? parseInt(staleTimeHeaderSeconds, 10) * 1000 - : STATIC_STALETIME_MS + writeSeedDataIntoCache( now, task, route, - now + staleTimeMs, + staleAt, seedData, isResponsePartial, segmentKey, spawnedEntries ) } + + // During a dynamic request, the server sends back new head data for the + // page. Overwrite the existing head with the new one. Note that we're + // intentionally not taking into account whether the existing head is + // already complete, even though the incoming head might not have finished + // streaming in yet. This is to prioritize consistency of the head with + // the segment data (though it's still not a guarantee, since some of the + // segment data may be reused from a previous request). + route.head = flightData.head + route.isHeadPartial = flightData.isHeadPartial + // TODO: Currently the stale time of the route tree represents the + // stale time of both the route tree *and* all the segment data. So we + // can't just overwrite this field; we have to use whichever value is + // lower. In the future, though, the plan is to track segment lifetimes + // separately from the route tree lifetime. + if (staleAt < route.staleAt) { + route.staleAt = staleAt + } } // Any entry that's still pending was intentionally not rendered by the // server, because it was inside the loading boundary. Mark them as rejected diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/page.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/page.tsx index 90db1c0f9c92f..1c3c2e2ac7744 100644 --- a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/page.tsx +++ b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/page.tsx @@ -43,6 +43,14 @@ export default function Page() { +
  • + + Page with PPR disabled and a dynamic head, prefetch=true + +
  • ) diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-dynamic-head/page.tsx b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-dynamic-head/page.tsx new file mode 100644 index 0000000000000..3d3488f4b41d5 --- /dev/null +++ b/test/e2e/app-dir/segment-cache/incremental-opt-in/app/ppr-disabled-dynamic-head/page.tsx @@ -0,0 +1,27 @@ +import { Suspense } from 'react' +import { connection } from 'next/server' +import { Metadata } from 'next' + +export async function generateMetadata({ + searchParams, +}: { + searchParams: Promise<{ foo: string }> +}): Promise { + const { foo } = await searchParams + return { + title: 'Dynamic Title: ' + (foo ?? '(empty)'), + } +} + +async function Content() { + await connection() + return
    Page content
    +} + +export default function PPRDisabledDynamicHead() { + return ( + + + + ) +} diff --git a/test/e2e/app-dir/segment-cache/incremental-opt-in/segment-cache-incremental-opt-in.test.ts b/test/e2e/app-dir/segment-cache/incremental-opt-in/segment-cache-incremental-opt-in.test.ts index de6705a824bc6..a7cad8ea2599b 100644 --- a/test/e2e/app-dir/segment-cache/incremental-opt-in/segment-cache-incremental-opt-in.test.ts +++ b/test/e2e/app-dir/segment-cache/incremental-opt-in/segment-cache-incremental-opt-in.test.ts @@ -475,4 +475,41 @@ describe('segment cache (incremental opt in)', () => { ) } ) + + it('fully prefetch a page with a dynamic title', async () => { + let act + const browser = await next.browser('/', { + beforePageLoad(p) { + act = createRouterAct(p) + }, + }) + + await act( + async () => { + const checkbox = await browser.elementByCss( + 'input[data-link-accordion="/ppr-disabled-dynamic-head?foo=yay"]' + ) + await checkbox.click() + }, + // Because the link is prefetched with prefetch=true, we should be able to + // prefetch the title, even though it's dynamic. + { + includes: 'Dynamic Title: yay', + } + ) + + // When we navigate to the page, it should not make any additional + // network requests, because both the segment data and the head were + // fully prefetched. + await act(async () => { + const link = await browser.elementByCss( + 'a[href="/ppr-disabled-dynamic-head?foo=yay"]' + ) + await link.click() + const pageContent = await browser.elementById('page-content') + expect(await pageContent.text()).toBe('Page content') + const title = await browser.eval(() => document.title) + expect(title).toBe('Dynamic Title: yay') + }, 'no-requests') + }) }) From f0099cd448efe6f28b046d84ba4961a1d36f8153 Mon Sep 17 00:00:00 2001 From: Vercel Release Bot <88769842+vercel-release-bot@users.noreply.github.com> Date: Wed, 16 Jul 2025 11:08:41 -0700 Subject: [PATCH 10/13] Update Rspack development test manifest (#81702) This auto-generated PR updates the development integration test manifest used when testing Rspack. --- test/rspack-dev-tests-manifest.json | 82 +++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 5 deletions(-) diff --git a/test/rspack-dev-tests-manifest.json b/test/rspack-dev-tests-manifest.json index 5c9644c028dfe..313c225824682 100644 --- a/test/rspack-dev-tests-manifest.json +++ b/test/rspack-dev-tests-manifest.json @@ -448,12 +448,48 @@ "assignErrorIfEmpty should handle more complex routes", "assignErrorIfEmpty should handle multiple routes at the same trie node", "assignErrorIfEmpty should handle nested routes with multiple parameter depths", - "assignErrorIfEmpty should handle parameter value collisions", "assignErrorIfEmpty should handle routes at same trie node with different fallback parameter lengths", "filterUniqueParams should filter out duplicate parameters", "filterUniqueParams should handle more complex routes", - "filterUniqueRootParamsCombinations should handle multiple root parameters", - "filterUniqueRootParamsCombinations should return only the root parameters" + "generateParamPrefixCombinations should handle deep parameter hierarchies", + "generateParamPrefixCombinations should handle empty inputs", + "generateParamPrefixCombinations should handle empty routeParams with root params", + "generateParamPrefixCombinations should handle missing parameter keys in objects", + "generateParamPrefixCombinations should handle missing root params gracefully", + "generateParamPrefixCombinations should handle multiple route parameters", + "generateParamPrefixCombinations should handle parameter value collisions", + "generateParamPrefixCombinations should handle parameters with pipe characters", + "generateParamPrefixCombinations should handle root params not in route params", + "generateParamPrefixCombinations should handle routes without root params normally", + "generateParamPrefixCombinations should handle single root param", + "generateParamPrefixCombinations should handle test case scenario: route with extra param but missing value", + "generateParamPrefixCombinations should handle undefined parameters", + "generateParamPrefixCombinations should only generate combinations with complete root params", + "generateParamPrefixCombinations should prevent collisions with special characters", + "generateParamPrefixCombinations should return only the route parameters", + "generateRouteStaticParams Array parameter values should handle array parameter values", + "generateRouteStaticParams Array parameter values should handle mixed array and string parameters", + "generateRouteStaticParams Basic functionality should process multiple segments with generateStaticParams", + "generateRouteStaticParams Basic functionality should process single segment with generateStaticParams", + "generateRouteStaticParams Basic functionality should return empty array for empty segments", + "generateRouteStaticParams Basic functionality should return empty array for segments without generateStaticParams", + "generateRouteStaticParams Complex real-world scenarios should handle blog with optional catch-all", + "generateRouteStaticParams Complex real-world scenarios should handle e-commerce routing pattern", + "generateRouteStaticParams Complex real-world scenarios should handle i18n routing pattern", + "generateRouteStaticParams Deep nesting scenarios should handle deeply nested segments", + "generateRouteStaticParams Deep nesting scenarios should handle many parameter combinations", + "generateRouteStaticParams Empty and undefined handling should handle empty generateStaticParams results", + "generateRouteStaticParams Empty and undefined handling should handle generateStaticParams returning empty array with parent params", + "generateRouteStaticParams Empty and undefined handling should handle missing parameters in parent params", + "generateRouteStaticParams Error handling should handle generateStaticParams returning a rejected promise", + "generateRouteStaticParams Error handling should handle generateStaticParams throwing an error", + "generateRouteStaticParams Error handling should handle partially failing generateStaticParams", + "generateRouteStaticParams FetchCache configuration should not modify fetchCache when segment has no fetchCache config", + "generateRouteStaticParams FetchCache configuration should set fetchCache on store when segment has fetchCache config", + "generateRouteStaticParams FetchCache configuration should update fetchCache for multiple segments", + "generateRouteStaticParams Parameter inheritance should handle mixed segments (some with generateStaticParams, some without)", + "generateRouteStaticParams Parameter inheritance should inherit parent parameters", + "generateRouteStaticParams Performance considerations should handle recursive calls without stack overflow" ], "failed": [], "pending": [], @@ -1586,6 +1622,18 @@ "flakey": [], "runtimeError": false }, + "packages/next/src/server/route-modules/app-page/helpers/prerender-manifest-matcher.test.ts": { + "passed": [ + "PrerenderManifestMatcher match no match scenarios should return null when no matching route is found", + "PrerenderManifestMatcher match no match scenarios should return null when no routes match the fallback source route", + "PrerenderManifestMatcher match successful matches should handle when the fallbackSourceRoute is not set", + "PrerenderManifestMatcher match successful matches should respect route specificity order" + ], + "failed": [], + "pending": [], + "flakey": [], + "runtimeError": false + }, "packages/next/src/server/server-utils.test.ts": { "passed": [ "getParamsFromRouteMatches should handle optional params", @@ -6129,9 +6177,7 @@ "Dynamic IO Errors Dev Sync Dynamic Platform With Fallback - Math.random() should not show a collapsed redbox error", "Dynamic IO Errors Dev Sync Dynamic Platform Without Fallback - Math.random() should show a collapsed redbox error", "Dynamic IO Errors Dev Sync Dynamic Request client params should return `undefined` for `params.slug`", - "Dynamic IO Errors Dev Sync Dynamic Request client params should show a collapsed redbox with a sync access error", "Dynamic IO Errors Dev Sync Dynamic Request client searchParams should return `undefined` for `searchParams.foo`", - "Dynamic IO Errors Dev Sync Dynamic Request client searchParams should show a collapsed redbox with a sync access error", "Dynamic IO Errors Dev Sync Dynamic Request draftMode should return `undefined` for `draftMode().isEnabled`", "Dynamic IO Errors Dev Sync Dynamic Request server params should return `undefined` for `params.slug`", "Dynamic IO Errors Dev Sync Dynamic Request server params should show a collapsed redbox with a sync access error", @@ -6139,6 +6185,8 @@ "Dynamic IO Errors Dev Sync Dynamic Request server searchParams should show a collapsed redbox with a sync access error" ], "failed": [ + "Dynamic IO Errors Dev Sync Dynamic Request client params should show a collapsed redbox with a sync access error", + "Dynamic IO Errors Dev Sync Dynamic Request client searchParams should show a collapsed redbox with a sync access error", "Dynamic IO Errors Dev Sync Dynamic Request cookies should show a redbox with a sync access error and a runtime error", "Dynamic IO Errors Dev Sync Dynamic Request draftMode should show a collapsed redbox with a sync access error", "Dynamic IO Errors Dev Sync Dynamic Request headers should show a redbox with a sync access error and a runtime error" @@ -7131,6 +7179,7 @@ "app-dir - metadata-icons should only have 1 favicon link in root page", "app-dir - metadata-icons should re-insert the apple icons into the head after navigation", "app-dir - metadata-icons should re-insert the body icons into the head", + "app-dir - metadata-icons should re-insert the icons into head when icons are inserted in body during initial chunk", "app-dir - metadata-icons should render custom icons along with favicon in nested page", "app-dir - metadata-icons should render custom icons along with favicon in root page" ], @@ -8916,6 +8965,18 @@ "flakey": [], "runtimeError": false }, + "test/e2e/app-dir/script-before-interactive/script-before-interactive.test.ts": { + "passed": [ + "Script component with beforeInteractive strategy CSS class rendering should execute beforeInteractive script correctly", + "Script component with beforeInteractive strategy CSS class rendering should render multiple beforeInteractive scripts with correct class attributes", + "Script component with beforeInteractive strategy CSS class rendering should render script in document head with beforeInteractive strategy", + "Script component with beforeInteractive strategy CSS class rendering should render script tag with correct class attribute instead of classname" + ], + "failed": [], + "pending": [], + "flakey": [], + "runtimeError": false + }, "test/e2e/app-dir/scss/3rd-party-module/3rd-party-module.test.ts": { "passed": [ "3rd Party CSS Module Support ({\"sass\": \"1.54.0\"}) should render the module", @@ -9633,6 +9694,13 @@ "flakey": [], "runtimeError": false }, + "test/e2e/app-dir/sub-shell-generation/sub-shell-generation.test.ts": { + "passed": [], + "failed": [], + "pending": ["sub-shell-generation skipping dev test"], + "flakey": [], + "runtimeError": false + }, "test/e2e/app-dir/syntax-highlighter-crash/syntax-highlighter-crash.test.ts": { "passed": ["syntax-highlighter-crash should render the page"], "failed": [], @@ -11106,6 +11174,7 @@ "test/e2e/middleware-base-path/test/index.test.ts": { "passed": [ "Middleware base tests router.query must exist when Link clicked page routing", + "Middleware base tests should allow client-side navigation to the root", "Middleware base tests should execute from absolute paths" ], "failed": [], @@ -19805,6 +19874,7 @@ "Image Component Tests development mode should warn when img with layout=responsive is inside flex container", "Image Component Tests development mode should warn when loader is missing width", "Image Component Tests development mode should warn when priority prop is missing on LCP image", + "Image Component Tests development mode should warn when quality is 50", "Image Component Tests development mode should warn when using a very small image with placeholder=blur", "Image Component Tests development mode should warn when using sizes with incorrect layout", "Image Component Tests development mode should work when using flexbox", @@ -20073,6 +20143,7 @@ "Image Component Default Tests development mode should warn when legacy prop layout=responsive", "Image Component Default Tests development mode should warn when loader is missing width", "Image Component Default Tests development mode should warn when priority prop is missing on LCP image", + "Image Component Default Tests development mode should warn when quality is 50", "Image Component Default Tests development mode should warn when using a very small image with placeholder=blur", "Image Component Default Tests development mode should work when using flexbox", "Image Component Default Tests development mode should work when using overrideSrc prop", @@ -20295,6 +20366,7 @@ "Image Component Default Tests development mode should warn when legacy prop layout=responsive", "Image Component Default Tests development mode should warn when loader is missing width", "Image Component Default Tests development mode should warn when priority prop is missing on LCP image", + "Image Component Default Tests development mode should warn when quality is 50", "Image Component Default Tests development mode should warn when using a very small image with placeholder=blur", "Image Component Default Tests development mode should work when using flexbox", "Image Component Default Tests development mode should work when using overrideSrc prop", From 5444efa2d205bcbc49fbbde4a753582731b0a4a2 Mon Sep 17 00:00:00 2001 From: Vercel Release Bot <88769842+vercel-release-bot@users.noreply.github.com> Date: Wed, 16 Jul 2025 11:10:17 -0700 Subject: [PATCH 11/13] Update Rspack production test manifest (#81701) This auto-generated PR updates the production integration test manifest used when testing Rspack. --- test/rspack-build-tests-manifest.json | 53 +++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/test/rspack-build-tests-manifest.json b/test/rspack-build-tests-manifest.json index b30306f711822..715a4da34be00 100644 --- a/test/rspack-build-tests-manifest.json +++ b/test/rspack-build-tests-manifest.json @@ -3169,6 +3169,7 @@ "app-dir - metadata-icons should only have 1 favicon link in root page", "app-dir - metadata-icons should re-insert the apple icons into the head after navigation", "app-dir - metadata-icons should re-insert the body icons into the head", + "app-dir - metadata-icons should re-insert the icons into head when icons are inserted in body during initial chunk", "app-dir - metadata-icons should render custom icons along with favicon in nested page", "app-dir - metadata-icons should render custom icons along with favicon in root page" ], @@ -5172,6 +5173,18 @@ "flakey": [], "runtimeError": false }, + "test/e2e/app-dir/script-before-interactive/script-before-interactive.test.ts": { + "passed": [ + "Script component with beforeInteractive strategy CSS class rendering should execute beforeInteractive script correctly", + "Script component with beforeInteractive strategy CSS class rendering should render multiple beforeInteractive scripts with correct class attributes", + "Script component with beforeInteractive strategy CSS class rendering should render script in document head with beforeInteractive strategy", + "Script component with beforeInteractive strategy CSS class rendering should render script tag with correct class attribute instead of classname" + ], + "failed": [], + "pending": [], + "flakey": [], + "runtimeError": false + }, "test/e2e/app-dir/scss/3rd-party-module/3rd-party-module.test.ts": { "passed": [ "3rd Party CSS Module Support ({\"sass\": \"1.54.0\"}) should render the module", @@ -5949,6 +5962,21 @@ "flakey": [], "runtimeError": false }, + "test/e2e/app-dir/sub-shell-generation/sub-shell-generation.test.ts": { + "passed": [ + "sub-shell-generation should serve the correct shell /[lang]/[slug] should serve the correct shell for /es/1", + "sub-shell-generation should serve the correct shell /[lang]/[slug] should serve the correct shell for /es/2", + "sub-shell-generation should serve the correct shell /en/[slug] should serve the correct shell for /en/1", + "sub-shell-generation should serve the correct shell /en/[slug] should serve the correct shell for /en/2", + "sub-shell-generation should serve the correct shell /fr/1 should serve the correct shell for /fr/1", + "sub-shell-generation should serve the correct shell /fr/[slug] should serve the correct shell for /fr/2", + "sub-shell-generation should serve the correct shell /fr/[slug] should serve the correct shell for /fr/3" + ], + "failed": [], + "pending": [], + "flakey": [], + "runtimeError": false + }, "test/e2e/app-dir/syntax-highlighter-crash/syntax-highlighter-crash.test.ts": { "passed": ["syntax-highlighter-crash should render the page"], "failed": [], @@ -7408,6 +7436,7 @@ "test/e2e/middleware-base-path/test/index.test.ts": { "passed": [ "Middleware base tests router.query must exist when Link clicked page routing", + "Middleware base tests should allow client-side navigation to the root", "Middleware base tests should execute from absolute paths" ], "failed": [], @@ -16177,6 +16206,7 @@ "Image Component Tests development mode should warn when img with layout=responsive is inside flex container", "Image Component Tests development mode should warn when loader is missing width", "Image Component Tests development mode should warn when priority prop is missing on LCP image", + "Image Component Tests development mode should warn when quality is 50", "Image Component Tests development mode should warn when using a very small image with placeholder=blur", "Image Component Tests development mode should warn when using sizes with incorrect layout", "Image Component Tests development mode should work when using flexbox", @@ -16455,6 +16485,7 @@ "Image Component Default Tests development mode should warn when legacy prop layout=responsive", "Image Component Default Tests development mode should warn when loader is missing width", "Image Component Default Tests development mode should warn when priority prop is missing on LCP image", + "Image Component Default Tests development mode should warn when quality is 50", "Image Component Default Tests development mode should warn when using a very small image with placeholder=blur", "Image Component Default Tests development mode should work when using flexbox", "Image Component Default Tests development mode should work when using overrideSrc prop", @@ -16678,6 +16709,7 @@ "Image Component Default Tests development mode should warn when legacy prop layout=responsive", "Image Component Default Tests development mode should warn when loader is missing width", "Image Component Default Tests development mode should warn when priority prop is missing on LCP image", + "Image Component Default Tests development mode should warn when quality is 50", "Image Component Default Tests development mode should warn when using a very small image with placeholder=blur", "Image Component Default Tests development mode should work when using flexbox", "Image Component Default Tests development mode should work when using overrideSrc prop", @@ -18691,12 +18723,14 @@ }, "test/production/app-dir/build-output-prerender/build-output-prerender.test.ts": { "passed": [ - "build-output-prerender with --debug-prerender shows all prerender errors with readable stacks and code frames", - "build-output-prerender without --debug-prerender shows only a single prerender error with a mangled stack" + "build-output-prerender with a next config file with --debug-prerender shows all prerender errors with readable stacks and code frames", + "build-output-prerender with a next config file without --debug-prerender shows only a single prerender error with a mangled stack" ], "failed": [ - "build-output-prerender with --debug-prerender prints a warning and the customized experimental flags", - "build-output-prerender without --debug-prerender prints only the user-selected experimental flags" + "build-output-prerender with a next config file with --debug-prerender prints a warning and the customized experimental flags", + "build-output-prerender with a next config file without --debug-prerender prints only the user-selected experimental flags", + "build-output-prerender without a next config file with --debug-prerender prints a warning and the customized experimental flags", + "build-output-prerender without a next config file without --debug-prerender prints no experimental flags" ], "pending": [], "flakey": [], @@ -19105,6 +19139,12 @@ "custom server can navigate to /a", "custom server can navigate to /b", "custom server can navigate to /c", + "custom server provided config can navigate to /a", + "custom server provided config can navigate to /b", + "custom server provided config can navigate to /c", + "custom server provided config with app dir should render app with react canary", + "custom server provided config with app dir should render pages with installed react", + "custom server provided config with app dir when using \"use cache\" with a custom cache handler should not unset the custom server's ALS context", "custom server should log any error messages when server is started without \"quiet\" setting", "custom server with app dir should render app with react canary", "custom server with app dir should render pages with installed react", @@ -19677,11 +19717,10 @@ }, "test/production/pnpm-support/index.test.ts": { "passed": [ - "pnpm support should build with dependencies installed via pnpm" - ], - "failed": [ + "pnpm support should build with dependencies installed via pnpm", "pnpm support should execute client-side JS on each page in output: \"standalone\"" ], + "failed": [], "pending": [], "flakey": [], "runtimeError": false From a04a5efe80d88e603ded31c20645a0ddc76e1104 Mon Sep 17 00:00:00 2001 From: Luke Sandberg Date: Wed, 16 Jul 2025 11:11:26 -0700 Subject: [PATCH 12/13] Add an e2e test for the css serving issue (#81683) ## Add a regression test for when a not-found component depends on css and triggers a bug in turbopack To correctly serve js and css resources during server side rendering we construct a client manifest that lists all the server components and their required resources. Turbopack has a bug where we fail to collect css that is used by the page if it is also used by a not-found page (and other error handlers as well). When a not-found component is present all pages pages implicitly depend on this module and depend on it as an early dependency of the generated `app-page.js` file. This means if a `not-found.js` file (or a global error file) would happen to depend on the same css as a normal component we would associate it as a client-reference of that component instead of any other. Then on a server side render we would simply omit it. This PR adds a regression test for this issue. See #77861 and #79535 --- .../app/(default)/layout.tsx | 10 ++++++++ .../app/(default)/page.tsx | 3 +++ .../initial-css-not-found/app/layout.tsx | 5 ++++ .../initial-css-not-found/app/not-found.tsx | 18 ++++++++++++++ .../app/styles.module.css | 3 +++ .../initial-css-not-found.test.ts | 24 +++++++++++++++++++ .../initial-css-not-found/next.config.js | 6 +++++ 7 files changed, 69 insertions(+) create mode 100644 test/e2e/app-dir/initial-css-not-found/app/(default)/layout.tsx create mode 100644 test/e2e/app-dir/initial-css-not-found/app/(default)/page.tsx create mode 100644 test/e2e/app-dir/initial-css-not-found/app/layout.tsx create mode 100644 test/e2e/app-dir/initial-css-not-found/app/not-found.tsx create mode 100644 test/e2e/app-dir/initial-css-not-found/app/styles.module.css create mode 100644 test/e2e/app-dir/initial-css-not-found/initial-css-not-found.test.ts create mode 100644 test/e2e/app-dir/initial-css-not-found/next.config.js diff --git a/test/e2e/app-dir/initial-css-not-found/app/(default)/layout.tsx b/test/e2e/app-dir/initial-css-not-found/app/(default)/layout.tsx new file mode 100644 index 0000000000000..3f7a9c6663aad --- /dev/null +++ b/test/e2e/app-dir/initial-css-not-found/app/(default)/layout.tsx @@ -0,0 +1,10 @@ +import type { ReactNode } from 'react' +import styles from '../styles.module.css' + +export default function RootLayout({ children }: { children: ReactNode }) { + return ( + + {children} + + ) +} diff --git a/test/e2e/app-dir/initial-css-not-found/app/(default)/page.tsx b/test/e2e/app-dir/initial-css-not-found/app/(default)/page.tsx new file mode 100644 index 0000000000000..ff7159d9149fe --- /dev/null +++ b/test/e2e/app-dir/initial-css-not-found/app/(default)/page.tsx @@ -0,0 +1,3 @@ +export default function Page() { + return

    hello world

    +} diff --git a/test/e2e/app-dir/initial-css-not-found/app/layout.tsx b/test/e2e/app-dir/initial-css-not-found/app/layout.tsx new file mode 100644 index 0000000000000..43311f3894427 --- /dev/null +++ b/test/e2e/app-dir/initial-css-not-found/app/layout.tsx @@ -0,0 +1,5 @@ +import type { ReactNode } from 'react' + +export default function Layout({ children }: { children: ReactNode }) { + return children +} diff --git a/test/e2e/app-dir/initial-css-not-found/app/not-found.tsx b/test/e2e/app-dir/initial-css-not-found/app/not-found.tsx new file mode 100644 index 0000000000000..0a091793fd277 --- /dev/null +++ b/test/e2e/app-dir/initial-css-not-found/app/not-found.tsx @@ -0,0 +1,18 @@ +import styles from './styles.module.css' + +/** + * The mere existence of a not found page importing the same css as a layout used to prevent it from being served. + * + * See https://github.com/vercel/next.js/issues/77861 and https://github.com/vercel/next.js/issues/79535 + */ +export default function NotFoundPage() { + return ( + + +
    +

    Page not found

    +
    + + + ) +} diff --git a/test/e2e/app-dir/initial-css-not-found/app/styles.module.css b/test/e2e/app-dir/initial-css-not-found/app/styles.module.css new file mode 100644 index 0000000000000..a15c877ac01f4 --- /dev/null +++ b/test/e2e/app-dir/initial-css-not-found/app/styles.module.css @@ -0,0 +1,3 @@ +.foo { + color: red; +} diff --git a/test/e2e/app-dir/initial-css-not-found/initial-css-not-found.test.ts b/test/e2e/app-dir/initial-css-not-found/initial-css-not-found.test.ts new file mode 100644 index 0000000000000..83c2130b2f88c --- /dev/null +++ b/test/e2e/app-dir/initial-css-not-found/initial-css-not-found.test.ts @@ -0,0 +1,24 @@ +import { nextTestSetup } from 'e2e-utils' + +describe('initial-css-not-found', () => { + const { next } = nextTestSetup({ + files: __dirname, + }) + + // Regression test for a bug where the existence of a not-found page would prevent the css from being discovered. + // See https://github.com/vercel/next.js/issues/77861 and https://github.com/vercel/next.js/issues/79535 + it('should serve styles', async () => { + const browser = await next.browser('/') + + expect( + await browser.eval( + `window.getComputedStyle(document.querySelector('body')).color` + ) + ).toBe( + // This only fails in production turbopack builds + process.env.IS_TURBOPACK_TEST && process.env.NEXT_TEST_MODE !== 'dev' + ? 'rgb(0, 0, 0)' + : 'rgb(255, 0, 0)' + ) + }) +}) diff --git a/test/e2e/app-dir/initial-css-not-found/next.config.js b/test/e2e/app-dir/initial-css-not-found/next.config.js new file mode 100644 index 0000000000000..807126e4cf0bf --- /dev/null +++ b/test/e2e/app-dir/initial-css-not-found/next.config.js @@ -0,0 +1,6 @@ +/** + * @type {import('next').NextConfig} + */ +const nextConfig = {} + +module.exports = nextConfig From 382b79bcc9fb1446e8f88d7a321c365aaece8a2c Mon Sep 17 00:00:00 2001 From: "Sebastian \"Sebbie\" Silbermann" Date: Wed, 16 Jul 2025 20:45:34 +0200 Subject: [PATCH 13/13] [sourcemaps] Consistent cursor columns (#81375) Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> --- .../parseNotFoundError.ts | 18 +- .../call-stack-frame.stories.tsx | 8 +- .../call-stack-frame/call-stack-frame.tsx | 7 +- .../call-stack/call-stack.stories.tsx | 8 +- .../code-frame/code-frame.stories.tsx | 4 +- .../components/code-frame/code-frame.tsx | 12 +- .../code-frame/parse-code-frame.test.ts | 8 +- .../components/code-frame/parse-code-frame.ts | 10 +- .../error-overlay-call-stack.stories.tsx | 8 +- .../components/terminal/editor-link.tsx | 4 +- .../components/terminal/terminal.tsx | 17 +- .../dev-overlay/container/errors.stories.tsx | 4 +- .../container/runtime-error/render-error.tsx | 5 +- .../dev-overlay/storybook/errors.ts | 24 +- .../utils/parse-component-stack.ts | 19 +- .../dev-overlay/utils/use-open-in-editor.ts | 18 +- .../src/next-devtools/server/launch-editor.ts | 42 ++- .../next/src/next-devtools/server/shared.ts | 14 +- .../src/next-devtools/shared/stack-frame.ts | 12 +- .../src/server/dev/browser-logs/source-map.ts | 7 +- .../src/server/dev/middleware-turbopack.ts | 49 ++-- .../next/src/server/dev/middleware-webpack.ts | 47 ++-- packages/next/src/server/lib/parse-stack.ts | 19 +- packages/next/src/server/lib/source-maps.ts | 2 + .../next/src/server/patch-error-inspect.ts | 94 ++++--- .../acceptance-app/ReactRefreshLogBox.test.ts | 92 +++---- .../acceptance-app/rsc-runtime-errors.test.ts | 45 +--- .../dynamic-io-dev-errors.test.ts | 8 +- .../error-ignored-frames.test.ts | 2 +- .../server-navigation-error.test.ts | 172 ++++-------- .../use-cache-errors/use-cache-errors.test.ts | 22 +- .../middleware-errors/index.test.ts | 30 +-- .../dynamic-io-errors.test.ts | 87 +++--- .../dynamic-io/dynamic-io.console.test.ts | 12 +- .../server-source-maps-edge.test.ts | 18 +- .../server-source-maps.test.ts | 116 ++++---- .../use-cache-close-over-function.test.ts | 47 ++-- .../use-cache-hanging-inputs.test.ts | 10 +- ...use-cache-standalone-search-params.test.ts | 2 +- ...-good-stack-traces-in-edge-runtime.test.ts | 38 +-- .../test/index.test.js | 62 +++-- .../server-side-dev-errors/test/index.test.js | 251 +++++++++--------- .../build-output-prerender.test.ts | 88 +++--- .../src/references/esm/base.rs | 25 +- ...e_dynamic-import_input_lib_b2d8c81e.js.map | 12 +- ...shake_export-named_input_058a40bc._.js.map | 8 +- ...e_export-namespace_input_f7fde6f3._.js.map | 14 +- ...e_import-named-all_input_00b867a0._.js.map | 8 +- ...shake_import-named_input_f64e7412._.js.map | 8 +- ...e_import-namespace_input_25e69485._.js.map | 14 +- ...import-side-effect_input_e082b9f6._.js.map | 6 +- ...equire-side-effect_input_f83a22d6._.js.map | 12 +- ...e-shake-test-1_input_index_09a16221.js.map | 12 +- ..._basic_async_chunk_input_46366300._.js.map | 2 +- ..._basic_async_chunk_input_b274c771._.js.map | 2 +- ..._async_chunk_build_input_1e41378a._.js.map | 2 +- ..._async_chunk_build_input_23e8ba79._.js.map | 2 +- ...shot_basic_chunked_input_1efdaca0._.js.map | 2 +- ...shot_basic_shebang_input_d5e8dcd4._.js.map | 2 +- ...ic_top-level-await_input_9acd43f4._.js.map | 2 +- ...ic_top-level-await_input_aa0a0c39._.js.map | 2 +- ...ot_css_css-modules_input_8f2e7f32._.js.map | 2 +- ...s_snapshot_css_css_input_6dc4af09._.js.map | 2 +- ...shot_css_embed-url_input_4242144a._.js.map | 2 +- ...t_css_minification_input_cd94b040._.js.map | 2 +- ...t_very-dynamic_input_index_c4e3aa79.js.map | 2 +- ...rbopack-tests_tests_snapshot_6fdc60d8._.js | 2 +- ...ack-tests_tests_snapshot_6fdc60d8._.js.map | 2 +- ..._duplicate-binding_input_8498b7ee._.js.map | 2 +- ...pshot_imports_json_input_52abdb3f._.js.map | 2 +- ...shot_imports_order_input_152f317f._.js.map | 2 +- ...static-and-dynamic_input_ab9cac73._.js.map | 2 +- ...hot_imports_static_input_89ddd9a2._.js.map | 2 +- ...ath-imports-nested_input_2e0531bf._.js.map | 4 +- ...ts_subpath-imports_input_1e655205._.js.map | 2 +- ...export-with-locals_input_6ca4cc64._.js.map | 2 +- ...effect-free-facade_input_71bae14d._.js.map | 2 +- ..._tree-shake-test-1_input_80df1e23._.js.map | 2 +- ...node_spawn_dynamic_input_d33fdf1c._.js.map | 2 +- ...de_spawn_node_eval_input_bf21d136._.js.map | 2 +- ..._duplicate-imports_input_739fb2d3._.js.map | 2 +- ...split-shared_input_x_inner_9793feec.js.map | 2 +- ...plit-shared_input_y_middle_aa5cba2d.js.map | 2 +- ...s_input-source-map_input_965ec6d6._.js.map | 2 +- ...ack-tests_tests_snapshot_398e2526._.js.map | 2 +- ...ack-tests_tests_snapshot_b56e07c9._.js.map | 2 +- ...t_jsconfig-baseurl_input_50efc170._.js.map | 2 +- ...t_tsconfig-baseurl_input_88264193._.js.map | 2 +- ...ack-tests_tests_snapshot_f038421b._.js.map | 2 +- ...ack-tests_tests_snapshot_cff3cff1._.js.map | 2 +- ...tends-relative-dir_input_ef6815c7._.js.map | 2 +- ...xtends-without-ext_input_fcdb4390._.js.map | 2 +- ...t_tsconfig-extends_input_39e68707._.js.map | 2 +- 93 files changed, 822 insertions(+), 941 deletions(-) diff --git a/packages/next/src/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.ts b/packages/next/src/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.ts index deb34e4b03f5e..9ff3858866cd6 100644 --- a/packages/next/src/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.ts +++ b/packages/next/src/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.ts @@ -57,7 +57,7 @@ async function getSourceFrame( input: any, fileName: any, compilation: any -): Promise<{ frame: string; lineNumber: string; column: string }> { +): Promise<{ frame: string; line1: string; column1: string }> { try { const loc = input.loc || input.dependencies.map((d: any) => d.loc).filter(Boolean)[0] @@ -83,21 +83,21 @@ async function getSourceFrame( arguments: [], file: fileName, methodName: '', - lineNumber: loc.start.line, + line1: loc.start.line, // loc is 0-based but columns in stack frames are 1-based. - column: (loc.start.column ?? 0) + 1, + column1: (loc.start.column ?? 0) + 1, }, }) return { frame: result?.originalCodeFrame ?? '', - lineNumber: result?.originalStackFrame?.lineNumber?.toString() ?? '', - column: result?.originalStackFrame?.column?.toString() ?? '', + line1: result?.originalStackFrame?.line1?.toString() ?? '', + column1: result?.originalStackFrame?.column1?.toString() ?? '', } } } catch {} - return { frame: '', lineNumber: '', column: '' } + return { frame: '', line1: '', column1: '' } } function getFormattedFileName( @@ -141,7 +141,7 @@ export async function getNotFoundError( } try { - const { frame, lineNumber, column } = await getSourceFrame( + const { frame, line1, column1 } = await getSourceFrame( input, fileName, compilation @@ -181,8 +181,8 @@ export async function getNotFoundError( const formattedFileName = getFormattedFileName( fileName, module, - lineNumber, - column + line1, + column1 ) return new SimpleWebpackError(formattedFileName, message) diff --git a/packages/next/src/next-devtools/dev-overlay/components/call-stack-frame/call-stack-frame.stories.tsx b/packages/next/src/next-devtools/dev-overlay/components/call-stack-frame/call-stack-frame.stories.tsx index 918c01110e6f6..38d3d12d8cdae 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/call-stack-frame/call-stack-frame.stories.tsx +++ b/packages/next/src/next-devtools/dev-overlay/components/call-stack-frame/call-stack-frame.stories.tsx @@ -34,16 +34,16 @@ const frame = { file: './app/page.tsx', methodName: 'MyComponent', arguments: [], - lineNumber: 10, - column: 5, + line1: 10, + column1: 5, ignored: false, }, sourceStackFrame: { file: './app/page.tsx', methodName: 'MyComponent', arguments: [], - lineNumber: 10, - column: 5, + line1: 10, + column1: 5, }, error: false as const, reason: null, diff --git a/packages/next/src/next-devtools/dev-overlay/components/call-stack-frame/call-stack-frame.tsx b/packages/next/src/next-devtools/dev-overlay/components/call-stack-frame/call-stack-frame.tsx index db2ea0df01562..32f51a3763cd7 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/call-stack-frame/call-stack-frame.tsx +++ b/packages/next/src/next-devtools/dev-overlay/components/call-stack-frame/call-stack-frame.tsx @@ -1,4 +1,3 @@ -import type { StackFrame } from 'next/dist/compiled/stacktrace-parser' import type { OriginalStackFrame } from '../../../shared/stack-frame' import { HotlinkedText } from '../hot-linked-text' @@ -11,14 +10,14 @@ export const CallStackFrame: React.FC<{ }> = function CallStackFrame({ frame }) { // TODO: ability to expand resolved frames - const f: StackFrame = frame.originalStackFrame ?? frame.sourceStackFrame + const f = frame.originalStackFrame ?? frame.sourceStackFrame const hasSource = Boolean(frame.originalCodeFrame) const open = useOpenInEditor( hasSource ? { file: f.file, - lineNumber: f.lineNumber, - column: f.column, + line1: f.line1 ?? 1, + column1: f.column1 ?? 1, } : undefined ) diff --git a/packages/next/src/next-devtools/dev-overlay/components/call-stack/call-stack.stories.tsx b/packages/next/src/next-devtools/dev-overlay/components/call-stack/call-stack.stories.tsx index 3538a671d67e4..07ab91738c90c 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/call-stack/call-stack.stories.tsx +++ b/packages/next/src/next-devtools/dev-overlay/components/call-stack/call-stack.stories.tsx @@ -33,16 +33,16 @@ const frame = { file: './app/page.tsx', methodName: 'MyComponent', arguments: [], - lineNumber: 10, - column: 5, + line1: 10, + column1: 5, ignored: false, }, sourceStackFrame: { file: './app/page.tsx', methodName: 'MyComponent', arguments: [], - lineNumber: 10, - column: 5, + line1: 10, + column1: 5, }, originalCodeFrame: 'export default function MyComponent() {', error: false as const, diff --git a/packages/next/src/next-devtools/dev-overlay/components/code-frame/code-frame.stories.tsx b/packages/next/src/next-devtools/dev-overlay/components/code-frame/code-frame.stories.tsx index 2cab247303226..fa8b692c4d78f 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/code-frame/code-frame.stories.tsx +++ b/packages/next/src/next-devtools/dev-overlay/components/code-frame/code-frame.stories.tsx @@ -17,8 +17,8 @@ const baseStackFrame = { file: './app/page.tsx', methodName: 'Home', arguments: [], - lineNumber: 10, - column: 5, + line1: 10, + column1: 5, } export const SimpleCodeFrame: Story = { diff --git a/packages/next/src/next-devtools/dev-overlay/components/code-frame/code-frame.tsx b/packages/next/src/next-devtools/dev-overlay/components/code-frame/code-frame.tsx index 6664ddb7f6a57..25e132c694712 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/code-frame/code-frame.tsx +++ b/packages/next/src/next-devtools/dev-overlay/components/code-frame/code-frame.tsx @@ -1,7 +1,6 @@ -import type { StackFrame } from 'next/dist/compiled/stacktrace-parser' import { useMemo } from 'react' import { HotlinkedText } from '../hot-linked-text' -import { getFrameSource } from '../../../shared/stack-frame' +import { getFrameSource, type StackFrame } from '../../../shared/stack-frame' import { useOpenInEditor } from '../../utils/use-open-in-editor' import { ExternalIcon } from '../../icons/external' import { FileIcon } from '../../icons/file' @@ -11,7 +10,10 @@ import { parseLineNumberFromCodeFrameLine, } from './parse-code-frame' -export type CodeFrameProps = { stackFrame: StackFrame; codeFrame: string } +export type CodeFrameProps = { + stackFrame: StackFrame + codeFrame: string +} export function CodeFrame({ stackFrame, codeFrame }: CodeFrameProps) { const parsedLineStates = useMemo(() => { @@ -27,8 +29,8 @@ export function CodeFrame({ stackFrame, codeFrame }: CodeFrameProps) { const open = useOpenInEditor({ file: stackFrame.file, - lineNumber: stackFrame.lineNumber, - column: stackFrame.column, + line1: stackFrame.line1 ?? 1, + column1: stackFrame.column1 ?? 1, }) const fileExtension = stackFrame?.file?.split('.').pop() diff --git a/packages/next/src/next-devtools/dev-overlay/components/code-frame/parse-code-frame.test.ts b/packages/next/src/next-devtools/dev-overlay/components/code-frame/parse-code-frame.test.ts index d8f5b2fa59723..d902e0ba8e580 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/code-frame/parse-code-frame.test.ts +++ b/packages/next/src/next-devtools/dev-overlay/components/code-frame/parse-code-frame.test.ts @@ -9,8 +9,8 @@ describe('parse line numbers', () => { const input = { stackFrame: { file: 'app/page.tsx', - lineNumber: 2, - column: 9, + line1: 2, + column1: 9, methodName: 'Page', arguments: [], ignored: false, @@ -61,8 +61,8 @@ describe('parse line numbers', () => { const input = { stackFrame: { file: 'app/page.tsx', - lineNumber: 6, - column: 7, + line1: 6, + column1: 7, methodName: 'Page', arguments: [], }, diff --git a/packages/next/src/next-devtools/dev-overlay/components/code-frame/parse-code-frame.ts b/packages/next/src/next-devtools/dev-overlay/components/code-frame/parse-code-frame.ts index 1301c67d11d20..44a473b28f07b 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/code-frame/parse-code-frame.ts +++ b/packages/next/src/next-devtools/dev-overlay/components/code-frame/parse-code-frame.ts @@ -1,6 +1,6 @@ -import type { StackFrame } from 'next/dist/compiled/stacktrace-parser' import Anser, { type AnserJsonEntry } from 'next/dist/compiled/anser' import stripAnsi from 'next/dist/compiled/strip-ansi' +import type { StackFrame } from '../../../shared/stack-frame' // Strip leading spaces out of the code frame export function formatCodeFrame(codeFrame: string) { @@ -77,19 +77,19 @@ export function parseLineNumberFromCodeFrameLine( stackFrame: StackFrame ) { let lineNumberToken: AnserJsonEntry | undefined - let lineNumber: string | undefined + let line1: string | undefined // parse line number from line first 2 tokens // e.g. ` > 1 | const foo = 'bar'` => `1`, first token is `1 |` // e.g. ` 2 | const foo = 'bar'` => `2`. first 2 tokens are ' ' and ' 2 |' if (line[0]?.content === '>' || line[0]?.content === ' ') { lineNumberToken = line[1] - lineNumber = lineNumberToken?.content?.replace('|', '')?.trim() + line1 = lineNumberToken?.content?.replace('|', '')?.trim() } // When the line number is possibly undefined, it can be just the non-source code line // e.g. the ^ sign can also take a line, we skip rendering line number for it return { - lineNumber, - isErroredLine: lineNumber === stackFrame.lineNumber?.toString(), + lineNumber: line1, + isErroredLine: line1 === stackFrame.line1?.toString(), } } diff --git a/packages/next/src/next-devtools/dev-overlay/components/errors/error-overlay-call-stack/error-overlay-call-stack.stories.tsx b/packages/next/src/next-devtools/dev-overlay/components/errors/error-overlay-call-stack/error-overlay-call-stack.stories.tsx index eefc507caf531..29ce805940f02 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/errors/error-overlay-call-stack/error-overlay-call-stack.stories.tsx +++ b/packages/next/src/next-devtools/dev-overlay/components/errors/error-overlay-call-stack/error-overlay-call-stack.stories.tsx @@ -33,16 +33,16 @@ const frame = { file: './app/page.tsx', methodName: 'MyComponent', arguments: [], - lineNumber: 10, - column: 5, + line1: 10, + column1: 5, ignored: false, }, sourceStackFrame: { file: './app/page.tsx', methodName: 'MyComponent', arguments: [], - lineNumber: 10, - column: 5, + line1: 10, + column1: 5, }, originalCodeFrame: 'export default function MyComponent() {', error: false as const, diff --git a/packages/next/src/next-devtools/dev-overlay/components/terminal/editor-link.tsx b/packages/next/src/next-devtools/dev-overlay/components/terminal/editor-link.tsx index f2d13862106e3..575e010171344 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/terminal/editor-link.tsx +++ b/packages/next/src/next-devtools/dev-overlay/components/terminal/editor-link.tsx @@ -11,8 +11,8 @@ type EditorLinkProps = { export function EditorLink({ file, location }: EditorLinkProps) { const open = useOpenInEditor({ file, - lineNumber: location?.line ?? 1, - column: location?.column ?? 0, + line1: location?.line ?? 1, + column1: location?.column ?? 1, }) return ( diff --git a/packages/next/src/next-devtools/dev-overlay/components/terminal/terminal.tsx b/packages/next/src/next-devtools/dev-overlay/components/terminal/terminal.tsx index df0412c643b06..207ab47ea7d75 100644 --- a/packages/next/src/next-devtools/dev-overlay/components/terminal/terminal.tsx +++ b/packages/next/src/next-devtools/dev-overlay/components/terminal/terminal.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { HotlinkedText } from '../hot-linked-text' import { EditorLink } from './editor-link' import { ExternalIcon } from '../../icons/external' -import { getFrameSource } from '../../../shared/stack-frame' +import { getFrameSource, type StackFrame } from '../../../shared/stack-frame' import { useOpenInEditor } from '../../utils/use-open-in-editor' import { FileIcon } from '../../icons/file' @@ -22,8 +22,8 @@ function getFile(lines: string[]) { fileName: hasLocation ? fileName : contentFileName, location: hasLocation ? { - line: parsedLine, - column: parsedColumn, + line1: parsedLine, + column1: parsedColumn, } : undefined, } @@ -74,18 +74,19 @@ export const Terminal: React.FC = function Terminal({ }) }, [source]) + console.log({ file }) const open = useOpenInEditor({ file: file?.fileName, - lineNumber: file?.location?.line ?? 1, - column: file?.location?.column ?? 0, + line1: file?.location?.line1 ?? 1, + column1: file?.location?.column1 ?? 1, }) - const stackFrame = { + const stackFrame: StackFrame = { file: file?.fileName ?? null, methodName: '', arguments: [], - lineNumber: file?.location?.line ?? null, - column: file?.location?.column ?? null, + line1: file?.location?.line1 ?? null, + column1: file?.location?.column1 ?? null, } const fileExtension = stackFrame?.file?.split('.').pop() diff --git a/packages/next/src/next-devtools/dev-overlay/container/errors.stories.tsx b/packages/next/src/next-devtools/dev-overlay/container/errors.stories.tsx index ef73ed2d2e1a5..6cf4da618fe0f 100644 --- a/packages/next/src/next-devtools/dev-overlay/container/errors.stories.tsx +++ b/packages/next/src/next-devtools/dev-overlay/container/errors.stories.tsx @@ -98,8 +98,8 @@ export const WithHydrationWarning: Story = { file: 'app/page.tsx', methodName: 'Home', arguments: [], - lineNumber: 10, - column: 5, + line1: 10, + column1: 5, }, }, ]), diff --git a/packages/next/src/next-devtools/dev-overlay/container/runtime-error/render-error.tsx b/packages/next/src/next-devtools/dev-overlay/container/runtime-error/render-error.tsx index 39717aeb4cc31..8544e3f968bfc 100644 --- a/packages/next/src/next-devtools/dev-overlay/container/runtime-error/render-error.tsx +++ b/packages/next/src/next-devtools/dev-overlay/container/runtime-error/render-error.tsx @@ -1,12 +1,11 @@ -import type { OverlayState } from '../../shared' -import type { OverlayDispatch } from '../../shared' +import type { OverlayDispatch, OverlayState } from '../../shared' +import type { StackFrame } from '../../../shared/stack-frame' import { useMemo, useState, useEffect } from 'react' import { getErrorByType, type ReadyRuntimeError, } from '../../utils/get-error-by-type' -import type { StackFrame } from 'next/dist/compiled/stacktrace-parser' import type { ComponentStackFrame } from '../../utils/parse-component-stack' import { usePersistentCacheErrorDetection } from '../../components/errors/error-overlay-toolbar/restart-server-button' diff --git a/packages/next/src/next-devtools/dev-overlay/storybook/errors.ts b/packages/next/src/next-devtools/dev-overlay/storybook/errors.ts index 06a2ccabb84d8..7269356e8ccc9 100644 --- a/packages/next/src/next-devtools/dev-overlay/storybook/errors.ts +++ b/packages/next/src/next-devtools/dev-overlay/storybook/errors.ts @@ -15,16 +15,16 @@ const sourceStackFrame = { file: 'app/page.tsx', methodName: 'Home', arguments: [], - lineNumber: 2, - column: 9, + line1: 2, + column1: 9, } const originalStackFrame = { file: 'app/page.tsx', methodName: 'Home', arguments: [], - lineNumber: 2, - column: 9, + line1: 2, + column1: 9, ignored: false, } @@ -33,16 +33,16 @@ const frame = { file: './app/page.tsx', methodName: 'MyComponent', arguments: [], - lineNumber: 10, - column: 5, + line1: 10, + column1: 5, ignored: false, }, sourceStackFrame: { file: './app/page.tsx', methodName: 'MyComponent', arguments: [], - lineNumber: 10, - column: 5, + line1: 10, + column1: 5, }, originalCodeFrame: 'export default function MyComponent() {', error: false, @@ -66,8 +66,8 @@ export const errors: SupportedErrorEvent[] = [ { file: 'app/page.tsx', component: 'Home', - lineNumber: 10, - column: 5, + line1: 10, + column1: 5, canOpenInEditor: true, }, ], @@ -76,8 +76,8 @@ export const errors: SupportedErrorEvent[] = [ file: 'app/page.tsx', methodName: 'Home', arguments: [], - lineNumber: 10, - column: 5, + line1: 10, + column1: 5, }, ], type: 'runtime', diff --git a/packages/next/src/next-devtools/dev-overlay/utils/parse-component-stack.ts b/packages/next/src/next-devtools/dev-overlay/utils/parse-component-stack.ts index 7d674c8f146a6..94f91d4436b92 100644 --- a/packages/next/src/next-devtools/dev-overlay/utils/parse-component-stack.ts +++ b/packages/next/src/next-devtools/dev-overlay/utils/parse-component-stack.ts @@ -1,9 +1,9 @@ export type ComponentStackFrame = { canOpenInEditor: boolean component: string - file?: string - lineNumber?: number - column?: number + file: string | null + line1: number | null + column1: number | null } enum LocationType { @@ -42,8 +42,7 @@ function parseStackFrameLocation( /^(webpack-internal:\/\/\/|file:\/\/)(\(.*\)\/)?/, '' ) - const [, file, lineNumber, column] = - modulePath?.match(/^(.+):(\d+):(\d+)/) ?? [] + const [, file, line1, column1] = modulePath?.match(/^(.+):(\d+):(\d+)/) ?? [] switch (locationType) { case LocationType.FILE: @@ -51,8 +50,8 @@ function parseStackFrameLocation( return { canOpenInEditor: true, file, - lineNumber: lineNumber ? Number(lineNumber) : undefined, - column: column ? Number(column) : undefined, + line1: line1 ? Number(line1) : null, + column1: column1 ? Number(column1) : null, } // When the location is a URL we only show the file // TODO: Resolve http(s) URLs through sourcemaps @@ -62,6 +61,9 @@ function parseStackFrameLocation( default: { return { canOpenInEditor: false, + file: null, + line1: null, + column1: null, } } } @@ -83,6 +85,9 @@ export function parseComponentStack( componentStackFrames.push({ canOpenInEditor: false, component, + file: null, + line1: null, + column1: null, }) continue } diff --git a/packages/next/src/next-devtools/dev-overlay/utils/use-open-in-editor.ts b/packages/next/src/next-devtools/dev-overlay/utils/use-open-in-editor.ts index 911b6b3a91f62..58f753de1522f 100644 --- a/packages/next/src/next-devtools/dev-overlay/utils/use-open-in-editor.ts +++ b/packages/next/src/next-devtools/dev-overlay/utils/use-open-in-editor.ts @@ -2,20 +2,20 @@ import { useCallback } from 'react' export function useOpenInEditor({ file, - lineNumber, - column, + line1, + column1, }: { file?: string | null - lineNumber?: number | null - column?: number | null + line1?: number | null + column1?: number | null } = {}) { const openInEditor = useCallback(() => { - if (file == null || lineNumber == null || column == null) return + if (file == null || line1 == null || column1 == null) return const params = new URLSearchParams() params.append('file', file) - params.append('lineNumber', String(lineNumber)) - params.append('column', String(column)) + params.append('line1', String(line1)) + params.append('column1', String(column1)) self .fetch( @@ -27,12 +27,12 @@ export function useOpenInEditor({ () => {}, (cause) => { console.error( - `Failed to open file "${file} (${lineNumber}:${column})" in your editor. Cause:`, + `Failed to open file "${file} (${line1}:${column1})" in your editor. Cause:`, cause ) } ) - }, [file, lineNumber, column]) + }, [file, line1, column1]) return openInEditor } diff --git a/packages/next/src/next-devtools/server/launch-editor.ts b/packages/next/src/next-devtools/server/launch-editor.ts index c3277db855eee..a74053c69c044 100644 --- a/packages/next/src/next-devtools/server/launch-editor.ts +++ b/packages/next/src/next-devtools/server/launch-editor.ts @@ -144,8 +144,8 @@ const WINDOWS_FILE_NAME_ACCESS_LIST = function getArgumentsForLineNumber( editor: string, fileName: string, - lineNumber: number, - colNumber: number + line1: number, + column1: number ): string[] { const editorBasename = path.basename(editor).replace(/\.(exe|cmd|bat)$/i, '') switch (editorBasename) { @@ -155,30 +155,30 @@ function getArgumentsForLineNumber( case 'subl': case 'sublime': case 'sublime_text': { - return [fileName + ':' + lineNumber + ':' + colNumber] + return [fileName + ':' + line1 + ':' + column1] } case 'wstorm': case 'charm': { - return [fileName + ':' + lineNumber] + return [fileName + ':' + line1] } case 'notepad++': { - return ['-n' + lineNumber, '-c' + colNumber, fileName] + return ['-n' + line1, '-c' + column1, fileName] } case 'vim': case 'nvim': case 'mvim': case 'joe': case 'gvim': { - return ['+' + lineNumber, fileName] + return ['+' + line1, fileName] } case 'emacs': case 'emacsclient': { - return ['+' + lineNumber + ':' + colNumber, fileName] + return ['+' + line1 + ':' + column1, fileName] } case 'rmate': case 'mate': case 'mine': { - return ['--line', lineNumber.toString(), fileName] + return ['--line', line1.toString(), fileName] } case 'code': case 'Code': @@ -187,7 +187,7 @@ function getArgumentsForLineNumber( case 'Code - Insiders': case 'vscodium': case 'VSCodium': { - return ['-g', fileName + ':' + lineNumber + ':' + colNumber] + return ['-g', fileName + ':' + line1 + ':' + column1] } case 'appcode': case 'clion': @@ -206,7 +206,7 @@ function getArgumentsForLineNumber( case 'goland64': case 'rider': case 'rider64': { - return ['--line', lineNumber.toString(), fileName] + return ['--line', line1.toString(), fileName] } default: { // For all others, drop the lineNumber until we have @@ -315,11 +315,7 @@ export function escapeApplescriptStringFragment(input: string): string { return input.replaceAll(/[\\"]/g, (original) => `\\${original}`) } -export function launchEditor( - fileName: string, - lineNumber: number, - colNumber: number -) { +export function launchEditor(fileName: string, line1: number, column1: number) { if (!fs.existsSync(fileName)) { return } @@ -327,14 +323,14 @@ export function launchEditor( // Sanitize lineNumber to prevent malicious use on win32 // via: https://github.com/nodejs/node/blob/c3bb4b1aa5e907d489619fb43d233c3336bfc03d/lib/child_process.js#L333 // and it should be a positive integer - if (!(Number.isInteger(lineNumber) && lineNumber > 0)) { + if (!(Number.isInteger(line1) && line1 > 0)) { return } // colNumber is optional, but should be a positive integer too // default is 1 - if (!(Number.isInteger(colNumber) && colNumber > 0)) { - colNumber = 1 + if (!(Number.isInteger(column1) && column1 > 0)) { + column1 = 1 } let [editor, ...args] = guessEditor() @@ -385,9 +381,9 @@ export function launchEditor( return } - if (lineNumber) { + if (line1) { args = args.concat( - getArgumentsForLineNumber(editor, fileName, lineNumber, colNumber) + getArgumentsForLineNumber(editor, fileName, line1, column1) ) } else { args.push(fileName) @@ -433,8 +429,8 @@ export function launchEditor( // Open the file in editor if exists, otherwise return an error export async function openFileInEditor( filePath: string, - line: number, - col: number + line1: number, + column1: number ) { const result = { found: false, @@ -446,7 +442,7 @@ export async function openFileInEditor( ) if (existed) { try { - launchEditor(filePath, line, col) + launchEditor(filePath, line1, column1) result.found = true } catch (err) { result.error = err as Error diff --git a/packages/next/src/next-devtools/server/shared.ts b/packages/next/src/next-devtools/server/shared.ts index 42b7226fce75c..d9ce9c190ba02 100644 --- a/packages/next/src/next-devtools/server/shared.ts +++ b/packages/next/src/next-devtools/server/shared.ts @@ -1,8 +1,14 @@ -import type { StackFrame } from 'stacktrace-parser' import { codeFrameColumns } from 'next/dist/compiled/babel/code-frame' import isInternal from '../../shared/lib/is-internal' +import type { StackFrame } from '../../server/lib/parse-stack' import { ignoreListAnonymousStackFramesIfSandwiched as ignoreListAnonymousStackFramesIfSandwichedGeneric } from '../../server/lib/source-maps' +export type { StackFrame } + +export interface IgnorableStackFrame extends StackFrame { + ignored: boolean +} + export interface OriginalStackFramesRequest { frames: StackFrame[] isServer: boolean @@ -58,7 +64,7 @@ export function ignoreListAnonymousStackFramesIfSandwiched( * @note It ignores Next.js/React internals, as these can often be huge bundled files. */ export function getOriginalCodeFrame( - frame: StackFrame, + frame: IgnorableStackFrame, source: string | null, colors: boolean = process.stdout.isTTY ): string | null { @@ -71,9 +77,9 @@ export function getOriginalCodeFrame( { start: { // 1-based, but -1 means start line without highlighting - line: frame.lineNumber ?? -1, + line: frame.line1 ?? -1, // 1-based, but 0 means whole line without column highlighting - column: frame.column ?? 0, + column: frame.column1 ?? 0, }, }, { forceColor: colors } diff --git a/packages/next/src/next-devtools/shared/stack-frame.ts b/packages/next/src/next-devtools/shared/stack-frame.ts index 0dc9682dcf03e..d65b96e4cbc24 100644 --- a/packages/next/src/next-devtools/shared/stack-frame.ts +++ b/packages/next/src/next-devtools/shared/stack-frame.ts @@ -1,14 +1,16 @@ -import type { StackFrame } from 'next/dist/compiled/stacktrace-parser' import type { OriginalStackFrameResponse, OriginalStackFrameResponseResult, OriginalStackFramesRequest, + StackFrame, } from '../server/shared' import { isWebpackInternalResource, formatFrameSourceFile, } from './webpack-module-path' +export type { StackFrame } + export interface ResolvedOriginalStackFrame extends OriginalStackFrameResponse { error: false reason: null @@ -157,14 +159,14 @@ export function getFrameSource(frame: StackFrame): string { } } - if (!isWebpackInternalResource(frame.file) && frame.lineNumber != null) { + if (!isWebpackInternalResource(frame.file) && frame.line1 != null) { // We don't need line and column numbers for anonymous sources because // there's no entrypoint for the location anyway. if (str && frame.file !== '') { - if (frame.column != null) { - str += ` (${frame.lineNumber}:${frame.column})` + if (frame.column1 != null) { + str += ` (${frame.line1}:${frame.column1})` } else { - str += ` (${frame.lineNumber})` + str += ` (${frame.line1})` } } } diff --git a/packages/next/src/server/dev/browser-logs/source-map.ts b/packages/next/src/server/dev/browser-logs/source-map.ts index 01e6c8f83fbdb..ea1f71352f299 100644 --- a/packages/next/src/server/dev/browser-logs/source-map.ts +++ b/packages/next/src/server/dev/browser-logs/source-map.ts @@ -1,9 +1,8 @@ -import type { StackFrame } from 'stacktrace-parser' import { getOriginalStackFrames as getOriginalStackFramesWebpack } from '../middleware-webpack' import { getOriginalStackFrames as getOriginalStackFramesTurbopack } from '../middleware-turbopack' import type { Project } from '../../../build/swc/types' import { dim } from '../../../lib/picocolors' -import { parseStack } from '../../lib/parse-stack' +import { parseStack, type StackFrame } from '../../lib/parse-stack' import path from 'path' import { LRUCache } from '../../lib/lru-cache' @@ -244,8 +243,8 @@ export async function getSourceMappedStackFrames( function formatStackFrame(frame: StackFrame): string { const functionName = frame.methodName || '' const location = - frame.file && frame.lineNumber - ? `${frame.file}:${frame.lineNumber}${frame.column ? `:${frame.column}` : ''}` + frame.file && frame.line1 + ? `${frame.file}:${frame.line1}${frame.column1 ? `:${frame.column1}` : ''}` : frame.file || '' return ` at ${functionName} (${location})` diff --git a/packages/next/src/server/dev/middleware-turbopack.ts b/packages/next/src/server/dev/middleware-turbopack.ts index a2a31c0c86b6b..1e44619cde86c 100644 --- a/packages/next/src/server/dev/middleware-turbopack.ts +++ b/packages/next/src/server/dev/middleware-turbopack.ts @@ -2,14 +2,15 @@ import type { IncomingMessage, ServerResponse } from 'http' import { getOriginalCodeFrame, ignoreListAnonymousStackFramesIfSandwiched, + type IgnorableStackFrame, type OriginalStackFrameResponse, type OriginalStackFramesRequest, type OriginalStackFramesResponse, + type StackFrame, } from '../../next-devtools/server/shared' import { middlewareResponse } from '../../next-devtools/server/middleware-response' import path from 'path' import { openFileInEditor } from '../../next-devtools/server/launch-editor' -import type { StackFrame } from 'next/dist/compiled/stacktrace-parser' import { SourceMapConsumer, type NullableMappedPosition, @@ -34,9 +35,10 @@ function shouldIgnorePath(modulePath: string): boolean { ) } -type IgnorableStackFrame = StackFrame & { ignored: boolean } - const currentSourcesByFile: Map> = new Map() +/** + * @returns 1-based lines and 1-based columns + */ async function batchedTraceSource( project: Project, frame: TurbopackStackFrame @@ -54,8 +56,8 @@ async function batchedTraceSource( return { frame: { file, - lineNumber: frame.line ?? 0, - column: frame.column ?? 0, + line1: frame.line ?? null, + column1: frame.column ?? null, methodName: frame.methodName ?? '', ignored: true, arguments: [], @@ -71,8 +73,8 @@ async function batchedTraceSource( return { frame: { file, - lineNumber: frame.line ?? 0, - column: frame.column ?? 0, + line1: frame.line ?? null, + column1: frame.column ?? null, methodName: frame.methodName ?? '', ignored: shouldIgnorePath(file), arguments: [], @@ -104,10 +106,10 @@ async function batchedTraceSource( } // TODO: get ignoredList from turbopack source map - const ignorableFrame = { + const ignorableFrame: IgnorableStackFrame = { file: sourceFrame.file, - lineNumber: sourceFrame.line ?? 0, - column: sourceFrame.column ?? 0, + line1: sourceFrame.line ?? null, + column1: sourceFrame.column ?? null, methodName: // We ignore the sourcemapped name since it won't be the correct name. // The callsite will point to the column of the variable name instead of the @@ -148,10 +150,10 @@ function createStackFrames( return { file, methodName: frame.methodName ?? '', - line: frame.lineNumber ?? 0, - column: frame.column ?? 0, + line: frame.line1 ?? undefined, + column: frame.column1 ?? undefined, isServer, - } satisfies TurbopackStackFrame + } }) .filter((f): f is TurbopackStackFrame => f !== undefined) } @@ -168,14 +170,14 @@ function createStackFrame( return { file, methodName: searchParams.get('methodName') ?? '', - line: parseInt(searchParams.get('lineNumber') ?? '0', 10) || 0, - column: parseInt(searchParams.get('column') ?? '0', 10) || 0, + line: parseInt(searchParams.get('line1') ?? '0', 10) || undefined, + column: parseInt(searchParams.get('column1') ?? '0', 10) || undefined, isServer: searchParams.get('isServer') === 'true', - } satisfies TurbopackStackFrame + } } /** - * @returns 1-based lines and 0-based columns + * @returns 1-based lines and 1-based columns */ async function nativeTraceSource( frame: TurbopackStackFrame @@ -230,8 +232,8 @@ async function nativeTraceSource( if (traced !== null) { const { originalPosition, sourceContent } = traced const applicableSourceMap = findApplicableSourceMapPayload( - frame.line ?? 0, - frame.column ?? 0, + (frame.line ?? 1) - 1, + (frame.column ?? 1) - 1, sourceMapPayload ) @@ -263,9 +265,10 @@ async function nativeTraceSource( frame.methodName ?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default') ?.replace('__webpack_exports__.', '') || '', - column: (originalPosition.column ?? 0) + 1, file: originalPosition.source, - lineNumber: originalPosition.line ?? 0, + line1: originalPosition.line, + column1: + originalPosition.column === null ? null : originalPosition.column + 1, // TODO: c&p from async createOriginalStackFrame but why not frame.arguments? arguments: [], ignored, @@ -309,10 +312,10 @@ async function createOriginalStackFrame( return { originalStackFrame: { arguments: traced.frame.arguments, - column: traced.frame.column, file: normalizedStackFrameLocation, + line1: traced.frame.line1, + column1: traced.frame.column1, ignored: traced.frame.ignored, - lineNumber: traced.frame.lineNumber, methodName: traced.frame.methodName, }, originalCodeFrame: getOriginalCodeFrame(traced.frame, traced.source), diff --git a/packages/next/src/server/dev/middleware-webpack.ts b/packages/next/src/server/dev/middleware-webpack.ts index ed240ca886c5e..aace1d91acf41 100644 --- a/packages/next/src/server/dev/middleware-webpack.ts +++ b/packages/next/src/server/dev/middleware-webpack.ts @@ -2,7 +2,6 @@ import { findSourceMap, type SourceMap } from 'module' import path from 'path' import { fileURLToPath, pathToFileURL } from 'url' import { SourceMapConsumer } from 'next/dist/compiled/source-map08' -import type { StackFrame } from 'next/dist/compiled/stacktrace-parser' import { getSourceMapFromFile } from './get-source-map-from-file' import { devirtualizeReactServerURL, @@ -15,6 +14,8 @@ import { openFileInEditor } from '../../next-devtools/server/launch-editor' import { getOriginalCodeFrame, ignoreListAnonymousStackFramesIfSandwiched, + type StackFrame, + type IgnorableStackFrame, type OriginalStackFrameResponse, type OriginalStackFramesRequest, type OriginalStackFramesResponse, @@ -42,10 +43,6 @@ function shouldIgnoreSource(sourceURL: string): boolean { type IgnoredSources = Array<{ url: string; ignored: boolean }> -export interface IgnorableStackFrame extends StackFrame { - ignored: boolean -} - type SourceAttributes = { sourcePosition: NullableMappedPosition sourceContent: string | null @@ -92,7 +89,7 @@ function getSourcePath(source: string) { */ async function findOriginalSourcePositionAndContent( sourceMap: ModernSourceMapPayload, - position: { lineNumber: number | null; column: number | null } + position: { line1: number | null; column1: number | null } ): Promise { let consumer: SourceMapConsumer try { @@ -109,9 +106,9 @@ async function findOriginalSourcePositionAndContent( try { const sourcePosition = consumer.originalPositionFor({ - line: position.lineNumber ?? 1, + line: position.line1 ?? 1, // 0-based columns out requires 0-based columns in. - column: (position.column ?? 1) - 1, + column: (position.column1 ?? 1) - 1, }) if (!sourcePosition.source) { @@ -241,8 +238,8 @@ export async function createOriginalStackFrame({ const traced: IgnorableStackFrame = { file: resolvedFilePath, - lineNumber: sourcePosition.line, - column: (sourcePosition.column ?? 0) + 1, + line1: sourcePosition.line, + column1: sourcePosition.column === null ? null : sourcePosition.column + 1, methodName: // We ignore the sourcemapped name since it won't be the correct name. // The callsite will point to the column of the variable name instead of the @@ -290,8 +287,8 @@ async function getSourceMapFromCompilation( async function getSource( frame: { file: string | null - lineNumber: number | null - column: number | null + line1: number | null + column1: number | null }, options: { getCompilations: () => webpack.Compilation[] @@ -317,8 +314,8 @@ async function getSource( return { type: 'file', sourceMap: findApplicableSourceMapPayload( - frame.lineNumber ?? 0, - frame.column ?? 0, + (frame.line1 ?? 1) - 1, + (frame.column1 ?? 1) - 1, sourceMapPayload )!, @@ -504,8 +501,8 @@ async function getOriginalStackFrame({ // This stack frame is used for the one that couldn't locate the source or source mapped frame const defaultStackFrame: IgnorableStackFrame = { file: defaultNormalizedStackFrameLocation, - lineNumber: frame.lineNumber, - column: frame.column ?? 1, + line1: frame.line1, + column1: frame.column1, methodName: frame.methodName, ignored: shouldIgnoreSource(filename), arguments: [], @@ -578,11 +575,7 @@ export function getOverlayMiddleware(options: { isServer, isEdgeServer, isAppDirectory, - frames: frames.map((frame) => ({ - ...frame, - lineNumber: frame.lineNumber ?? 0, - column: frame.column ?? 0, - })), + frames, clientStats, serverStats, edgeServerStats, @@ -596,8 +589,8 @@ export function getOverlayMiddleware(options: { const frame = { file: searchParams.get('file') as string, methodName: searchParams.get('methodName') as string, - lineNumber: parseInt(searchParams.get('lineNumber') ?? '0', 10) || 0, - column: parseInt(searchParams.get('column') ?? '0', 10) || 0, + line1: parseInt(searchParams.get('line1') ?? '1', 10) || 1, + column1: parseInt(searchParams.get('column1') ?? '1', 10) || 1, arguments: searchParams.getAll('arguments').filter(Boolean), } satisfies StackFrame @@ -622,8 +615,8 @@ export function getOverlayMiddleware(options: { ) openEditorResult = await openFileInEditor( filePath, - frame.lineNumber, - frame.column ?? 1 + frame.line1, + frame.column1 ?? 1 ) } if (openEditorResult.error) { @@ -674,8 +667,8 @@ export function getSourceMapMiddleware(options: { { file: filename, // Webpack doesn't use Index Source Maps - lineNumber: null, - column: null, + line1: null, + column1: null, }, { getCompilations: () => { diff --git a/packages/next/src/server/lib/parse-stack.ts b/packages/next/src/server/lib/parse-stack.ts index f60ba5d6116ad..146120b0a90c1 100644 --- a/packages/next/src/server/lib/parse-stack.ts +++ b/packages/next/src/server/lib/parse-stack.ts @@ -1,8 +1,17 @@ import { parse } from 'next/dist/compiled/stacktrace-parser' -import type { StackFrame } from 'next/dist/compiled/stacktrace-parser' const regexNextStatic = /\/_next(\/static\/.+)/ +export interface StackFrame { + file: string | null + methodName: string + arguments: string[] + /** 1-based */ + line1: number | null + /** 1-based */ + column1: number | null +} + export function parseStack( stack: string, distDir = process.env.__NEXT_DIST_DIR @@ -40,6 +49,12 @@ export function parseStack( } } } catch {} - return frame + return { + file: frame.file, + line1: frame.lineNumber, + column1: frame.column, + methodName: frame.methodName, + arguments: frame.arguments, + } }) } diff --git a/packages/next/src/server/lib/source-maps.ts b/packages/next/src/server/lib/source-maps.ts index a743a87f12cc9..98518fb6c2b4d 100644 --- a/packages/next/src/server/lib/source-maps.ts +++ b/packages/next/src/server/lib/source-maps.ts @@ -58,6 +58,8 @@ export function sourceMapIgnoreListsEverything( /** * Finds the sourcemap payload applicable to a given frame. * Equal to the input unless an Index Source Map is used. + * @param line0 - The line number of the frame, 0-based. + * @param column0 - The column number of the frame, 0-based. */ export function findApplicableSourceMapPayload( line0: number, diff --git a/packages/next/src/server/patch-error-inspect.ts b/packages/next/src/server/patch-error-inspect.ts index ebdfc75a02735..bfdda9844d346 100644 --- a/packages/next/src/server/patch-error-inspect.ts +++ b/packages/next/src/server/patch-error-inspect.ts @@ -3,14 +3,13 @@ import * as path from 'path' import * as url from 'url' import type * as util from 'util' import { SourceMapConsumer as SyncSourceMapConsumer } from 'next/dist/compiled/source-map' -import type { StackFrame } from 'next/dist/compiled/stacktrace-parser' import { type ModernSourceMapPayload, findApplicableSourceMapPayload, ignoreListAnonymousStackFramesIfSandwiched as ignoreListAnonymousStackFramesIfSandwichedGeneric, sourceMapIgnoreListsEverything, } from './lib/source-maps' -import { parseStack } from './lib/parse-stack' +import { parseStack, type StackFrame } from './lib/parse-stack' import { getOriginalCodeFrame } from '../next-devtools/server/shared' import { workUnitAsyncStorage } from './app-render/work-unit-async-storage.external' import { dim } from '../lib/picocolors' @@ -30,7 +29,7 @@ export function setBundlerFindSourceMapImplementation( bundlerFindSourceMapPayload = findSourceMapImplementation } -interface IgnoreableStackFrame extends StackFrame { +interface IgnorableStackFrame extends StackFrame { ignored: boolean } @@ -39,31 +38,36 @@ type SourceMapCache = Map< null | { map: SyncSourceMapConsumer; payload: ModernSourceMapPayload } > -function frameToString(frame: StackFrame): string { - let sourceLocation = frame.lineNumber !== null ? `:${frame.lineNumber}` : '' - if (frame.column !== null && sourceLocation !== '') { - sourceLocation += `:${frame.column}` +function frameToString( + methodName: string | null, + sourceURL: string | null, + line1: number | null, + column1: number | null +): string { + let sourceLocation = line1 !== null ? `:${line1}` : '' + if (column1 !== null && sourceLocation !== '') { + sourceLocation += `:${column1}` } let fileLocation: string | null if ( - frame.file !== null && - frame.file.startsWith('file://') && - URL.canParse(frame.file) + sourceURL !== null && + sourceURL.startsWith('file://') && + URL.canParse(sourceURL) ) { // If not relative to CWD, the path is ambiguous to IDEs and clicking will prompt to select the file first. // In a multi-app repo, this leads to potentially larger file names but will make clicking snappy. // There's no tradeoff for the cases where `dir` in `next dev [dir]` is omitted // since relative to cwd is both the shortest and snappiest. - fileLocation = path.relative(process.cwd(), url.fileURLToPath(frame.file)) - } else if (frame.file !== null && frame.file.startsWith('/')) { - fileLocation = path.relative(process.cwd(), frame.file) + fileLocation = path.relative(process.cwd(), url.fileURLToPath(sourceURL)) + } else if (sourceURL !== null && sourceURL.startsWith('/')) { + fileLocation = path.relative(process.cwd(), sourceURL) } else { - fileLocation = frame.file + fileLocation = sourceURL } - return frame.methodName - ? ` at ${frame.methodName} (${fileLocation}${sourceLocation})` + return methodName + ? ` at ${methodName} (${fileLocation}${sourceLocation})` : ` at ${fileLocation}${sourceLocation}` } @@ -100,7 +104,7 @@ interface SourcemappableStackFrame extends StackFrame { } interface SourceMappedFrame { - stack: IgnoreableStackFrame + stack: IgnorableStackFrame // DEV only code: string | null } @@ -110,11 +114,11 @@ function createUnsourcemappedFrame( ): SourceMappedFrame { return { stack: { - arguments: frame.arguments, - column: frame.column, file: frame.file, - lineNumber: frame.lineNumber, + line1: frame.line1, + column1: frame.column1, methodName: frame.methodName, + arguments: frame.arguments, ignored: shouldIgnoreListGeneratedFrame(frame.file), }, code: null, @@ -123,7 +127,7 @@ function createUnsourcemappedFrame( function ignoreListAnonymousStackFramesIfSandwiched( sourceMappedFrames: Array<{ - stack: IgnoreableStackFrame + stack: IgnorableStackFrame code: string | null }> ) { @@ -148,7 +152,7 @@ function getSourcemappedFrameIfPossible( sourceMapCache: SourceMapCache, inspectOptions: util.InspectOptions ): { - stack: IgnoreableStackFrame + stack: IgnorableStackFrame code: string | null } { const sourceMapCacheEntry = sourceMapCache.get(frame.file) @@ -222,13 +226,13 @@ function getSourcemappedFrameIfPossible( } const sourcePosition = sourceMapConsumer.originalPositionFor({ - column: frame.column ?? 0, - line: frame.lineNumber ?? 1, + column: (frame.column1 ?? 1) - 1, + line: frame.line1 ?? 1, }) const applicableSourceMap = findApplicableSourceMapPayload( - frame.lineNumber ?? 0, - frame.column ?? 0, + (frame.line1 ?? 1) - 1, + (frame.column1 ?? 1) - 1, sourceMapPayload ) let ignored = @@ -238,9 +242,9 @@ function getSourcemappedFrameIfPossible( return { stack: { arguments: frame.arguments, - column: frame.column, file: frame.file, - lineNumber: frame.lineNumber, + line1: frame.line1, + column1: frame.column1, methodName: frame.methodName, ignored: ignored || shouldIgnoreListGeneratedFrame(frame.file), }, @@ -267,7 +271,7 @@ function getSourcemappedFrameIfPossible( ignored = applicableSourceMap.ignoreList?.includes(sourceIndex) ?? false } - const originalFrame: IgnoreableStackFrame = { + const originalFrame: IgnorableStackFrame = { // We ignore the sourcemapped name since it won't be the correct name. // The callsite will point to the column of the variable name instead of the // name of the enclosing function. @@ -275,9 +279,9 @@ function getSourcemappedFrameIfPossible( methodName: frame.methodName ?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default') ?.replace('__webpack_exports__.', ''), - column: sourcePosition.column, file: sourcePosition.source, - lineNumber: sourcePosition.line, + line1: sourcePosition.line, + column1: sourcePosition.column + 1, // TODO: c&p from async createOriginalStackFrame but why not frame.arguments? arguments: [], ignored, @@ -343,7 +347,7 @@ function parseAndSourceMap( const sourceMapCache: SourceMapCache = new Map() const sourceMappedFrames: Array<{ - stack: IgnoreableStackFrame + stack: IgnorableStackFrame code: string | null }> = [] let sourceFrame: null | string = null @@ -352,11 +356,11 @@ function parseAndSourceMap( sourceMappedFrames.push({ code: null, stack: { - arguments: frame.arguments, - column: frame.column, file: frame.file, - lineNumber: frame.lineNumber, + line1: frame.line1, + column1: frame.column1, methodName: frame.methodName, + arguments: frame.arguments, ignored: false, }, }) @@ -390,9 +394,25 @@ function parseAndSourceMap( const frame = sourceMappedFrames[i] if (!frame.stack.ignored) { - sourceMappedStack += '\n' + frameToString(frame.stack) + sourceMappedStack += + '\n' + + frameToString( + frame.stack.methodName, + frame.stack.file, + frame.stack.line1, + frame.stack.column1 + ) } else if (showIgnoreListed) { - sourceMappedStack += '\n' + dim(frameToString(frame.stack)) + sourceMappedStack += + '\n' + + dim( + frameToString( + frame.stack.methodName, + frame.stack.file, + frame.stack.line1, + frame.stack.column1 + ) + ) } } diff --git a/test/development/acceptance-app/ReactRefreshLogBox.test.ts b/test/development/acceptance-app/ReactRefreshLogBox.test.ts index 6203985c7a1fb..79defc8849db4 100644 --- a/test/development/acceptance-app/ReactRefreshLogBox.test.ts +++ b/test/development/acceptance-app/ReactRefreshLogBox.test.ts @@ -1159,41 +1159,25 @@ describe('ReactRefreshLogBox app', () => { ) const { browser } = sandbox - if (isTurbopack) { - // TODO(veil): investigate the column number is off by 1 between turbo and webpack - await expect(browser).toDisplayRedbox(` - { - "description": "This is an error from an anonymous function", - "environmentLabel": "Server", - "label": "Runtime Error", - "source": "app/page.js (4:13) @ - > 4 | throw new Error("This is an error from an anonymous function"); - | ^", - "stack": [ - " app/page.js (4:13)", - "Page app/page.js (5:6)", - ], - } - `) - } else { - await expect(browser).toDisplayRedbox(` - { - "description": "This is an error from an anonymous function", - "environmentLabel": "Server", - "label": "Runtime Error", - "source": "app/page.js (4:13) @ eval - > 4 | throw new Error("This is an error from an anonymous function"); - | ^", - "stack": [ - "eval app/page.js (4:13)", - "Page app/page.js (5:5)", - ], - } - `) - } + // TODO(veil): Turbopack uses correct name + // TODO(veil): Column of 2nd frame should be 7 + await expect(browser).toDisplayRedbox(` + { + "description": "This is an error from an anonymous function", + "environmentLabel": "Server", + "label": "Runtime Error", + "source": "app/page.js (4:13) @ ${isTurbopack ? '' : 'eval'} + > 4 | throw new Error("This is an error from an anonymous function"); + | ^", + "stack": [ + "${isTurbopack ? '' : 'eval'} app/page.js (4:13)", + "Page app/page.js (5:${isTurbopack ? '6' : '5'})", + ], + } + `) }) - test('should hide unrelated frames in stack trace with nodejs internal calls', async () => { + it('should hide unrelated frames in stack trace with nodejs internal calls', async () => { await using sandbox = await createSandbox( next, new Map([ @@ -1209,35 +1193,19 @@ describe('ReactRefreshLogBox app', () => { ) const { browser } = sandbox - if (isTurbopack) { - await expect(browser).toDisplayRedbox(` - { - "description": "Invalid URL", - "environmentLabel": "Server", - "label": "Runtime TypeError", - "source": "app/page.js (2:3) @ Page - > 2 | new URL("/", "invalid"); - | ^", - "stack": [ - "Page app/page.js (2:3)", - ], - } - `) - } else { - await expect(browser).toDisplayRedbox(` - { - "description": "Invalid URL", - "environmentLabel": "Server", - "label": "Runtime TypeError", - "source": "app/page.js (2:3) @ Page - > 2 | new URL("/", "invalid"); - | ^", - "stack": [ - "Page app/page.js (2:3)", - ], - } - `) - } + await expect(browser).toDisplayRedbox(` + { + "description": "Invalid URL", + "environmentLabel": "Server", + "label": "Runtime TypeError", + "source": "app/page.js (2:3) @ Page + > 2 | new URL("/", "invalid"); + | ^", + "stack": [ + "Page app/page.js (2:3)", + ], + } + `) }) test('Server component errors should open up in fullscreen', async () => { diff --git a/test/development/acceptance-app/rsc-runtime-errors.test.ts b/test/development/acceptance-app/rsc-runtime-errors.test.ts index e3e0812268960..bfb8c18bd5685 100644 --- a/test/development/acceptance-app/rsc-runtime-errors.test.ts +++ b/test/development/acceptance-app/rsc-runtime-errors.test.ts @@ -3,7 +3,7 @@ import { outdent } from 'outdent' import { FileRef, nextTestSetup } from 'e2e-utils' describe('Error overlay - RSC runtime errors', () => { - const { isTurbopack, next } = nextTestSetup({ + const { next } = nextTestSetup({ files: new FileRef(path.join(__dirname, 'fixtures', 'rsc-runtime-errors')), }) @@ -51,36 +51,19 @@ describe('Error overlay - RSC runtime errors', () => { const browser = await next.browser('/client') - // TODO(veil): Inconsistent cursor position - if (isTurbopack) { - await expect(browser).toDisplayRedbox(` - { - "description": "\`cookies\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context", - "environmentLabel": null, - "label": "Runtime Error", - "source": "app/client/page.js (4:15) @ Page - > 4 | callServerApi() - | ^", - "stack": [ - "Page app/client/page.js (4:15)", - ], - } - `) - } else { - await expect(browser).toDisplayRedbox(` - { - "description": "\`cookies\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context", - "environmentLabel": null, - "label": "Runtime Error", - "source": "app/client/page.js (4:16) @ Page - > 4 | callServerApi() - | ^", - "stack": [ - "Page app/client/page.js (4:16)", - ], - } - `) - } + await expect(browser).toDisplayRedbox(` + { + "description": "\`cookies\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context", + "environmentLabel": null, + "label": "Runtime Error", + "source": "app/client/page.js (4:16) @ Page + > 4 | callServerApi() + | ^", + "stack": [ + "Page app/client/page.js (4:16)", + ], + } + `) }) it('should show source code for jsx errors from server component', async () => { diff --git a/test/development/app-dir/dynamic-io-dev-errors/dynamic-io-dev-errors.test.ts b/test/development/app-dir/dynamic-io-dev-errors/dynamic-io-dev-errors.test.ts index 229e1c0d38cfe..4b12aad922159 100644 --- a/test/development/app-dir/dynamic-io-dev-errors/dynamic-io-dev-errors.test.ts +++ b/test/development/app-dir/dynamic-io-dev-errors/dynamic-io-dev-errors.test.ts @@ -96,9 +96,9 @@ describe('Dynamic IO Dev Errors', () => { `\nError: Route "/no-accessed-data": ` + `A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. ` + `See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense` + - '\n at Page (/app/no-accessed-data/page.js:1:30)' + + '\n at Page (/app/no-accessed-data/page.js:1:31)' + '\n> 1 | export default async function Page() {' + - '\n | ^' + + '\n | ^' + '\n 2 | await new Promise((r) => setTimeout(r, 200))' + '\n 3 | return

    Page

    ' + '\n 4 | }' @@ -108,9 +108,9 @@ describe('Dynamic IO Dev Errors', () => { `\nError: Route "/no-accessed-data": ` + `A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. ` + `See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense` + - '\n at Page (app/no-accessed-data/page.js:1:30)' + + '\n at Page (app/no-accessed-data/page.js:1:31)' + '\n> 1 | export default async function Page() {' + - '\n | ^' + + '\n | ^' + '\n 2 | await new Promise((r) => setTimeout(r, 200))' + '\n 3 | return

    Page

    ' + '\n 4 | }' diff --git a/test/development/app-dir/error-overlay/error-ignored-frames/error-ignored-frames.test.ts b/test/development/app-dir/error-overlay/error-ignored-frames/error-ignored-frames.test.ts index d7c6ca75af94e..8d9e79072db5a 100644 --- a/test/development/app-dir/error-overlay/error-ignored-frames/error-ignored-frames.test.ts +++ b/test/development/app-dir/error-overlay/error-ignored-frames/error-ignored-frames.test.ts @@ -54,7 +54,7 @@ describe('error-ignored-frames', () => { if (isTurbopack) { expect(defaultStack).toMatchInlineSnapshot(` "at (app/interleaved/page.tsx (7:11)) - at Page (app/interleaved/page.tsx (6:35))" + at Page (app/interleaved/page.tsx (6:36))" `) } else { expect(defaultStack).toMatchInlineSnapshot(` diff --git a/test/development/app-dir/server-navigation-error/server-navigation-error.test.ts b/test/development/app-dir/server-navigation-error/server-navigation-error.test.ts index 10dde5e7e8d94..c7d2cf31d1d33 100644 --- a/test/development/app-dir/server-navigation-error/server-navigation-error.test.ts +++ b/test/development/app-dir/server-navigation-error/server-navigation-error.test.ts @@ -1,7 +1,7 @@ import { nextTestSetup } from 'e2e-utils' describe('server-navigation-error', () => { - const { isTurbopack, next } = nextTestSetup({ + const { next } = nextTestSetup({ files: __dirname, }) @@ -9,69 +9,37 @@ describe('server-navigation-error', () => { it('should error on navigation API redirect', async () => { const browser = await next.browser('/pages/redirect') - if (isTurbopack) { - await expect(browser).toDisplayRedbox(` - { - "description": "Next.js navigation API is not allowed to be used in Pages Router.", - "environmentLabel": null, - "label": "Runtime Error", - "source": "pages/pages/redirect.tsx (4:11) @ Page - > 4 | redirect('/') - | ^", - "stack": [ - "Page pages/pages/redirect.tsx (4:11)", - ], - } - `) - } else { - await expect(browser).toDisplayRedbox(` - { - "description": "Next.js navigation API is not allowed to be used in Pages Router.", - "environmentLabel": null, - "label": "Runtime Error", - "source": "pages/pages/redirect.tsx (4:11) @ Page - > 4 | redirect('/') - | ^", - "stack": [ - "Page pages/pages/redirect.tsx (4:11)", - ], - } - `) - } + await expect(browser).toDisplayRedbox(` + { + "description": "Next.js navigation API is not allowed to be used in Pages Router.", + "environmentLabel": null, + "label": "Runtime Error", + "source": "pages/pages/redirect.tsx (4:11) @ Page + > 4 | redirect('/') + | ^", + "stack": [ + "Page pages/pages/redirect.tsx (4:11)", + ], + } + `) }) it('should error on navigation API notFound', async () => { const browser = await next.browser('/pages/not-found') - if (isTurbopack) { - await expect(browser).toDisplayRedbox(` - { - "description": "Next.js navigation API is not allowed to be used in Pages Router.", - "environmentLabel": null, - "label": "Runtime Error", - "source": "pages/pages/not-found.tsx (4:11) @ Page - > 4 | notFound() - | ^", - "stack": [ - "Page pages/pages/not-found.tsx (4:11)", - ], - } - `) - } else { - await expect(browser).toDisplayRedbox(` - { - "description": "Next.js navigation API is not allowed to be used in Pages Router.", - "environmentLabel": null, - "label": "Runtime Error", - "source": "pages/pages/not-found.tsx (4:11) @ Page - > 4 | notFound() - | ^", - "stack": [ - "Page pages/pages/not-found.tsx (4:11)", - ], - } - `) - } + await expect(browser).toDisplayRedbox(` + { + "description": "Next.js navigation API is not allowed to be used in Pages Router.", + "environmentLabel": null, + "label": "Runtime Error", + "source": "pages/pages/not-found.tsx (4:11) @ Page + > 4 | notFound() + | ^", + "stack": [ + "Page pages/pages/not-found.tsx (4:11)", + ], + } + `) }) }) @@ -81,71 +49,37 @@ describe('server-navigation-error', () => { // FIXME: the first request to middleware error load didn't show the redbox, need one more reload await browser.refresh() - // TODO(veil): investigate the column number is off by 1 between turbo and webpack - if (isTurbopack) { - await expect(browser).toDisplayRedbox(` - { - "description": "Next.js navigation API is not allowed to be used in Middleware.", - "environmentLabel": null, - "label": "Runtime Error", - "source": "middleware.ts (8:12) @ middleware - > 8 | redirect('/') - | ^", - "stack": [ - "middleware middleware.ts (8:12)", - ], - } - `) - } else { - await expect(browser).toDisplayRedbox(` - { - "description": "Next.js navigation API is not allowed to be used in Middleware.", - "environmentLabel": null, - "label": "Runtime Error", - "source": "middleware.ts (8:13) @ middleware - > 8 | redirect('/') - | ^", - "stack": [ - "middleware middleware.ts (8:13)", - ], - } - `) - } + await expect(browser).toDisplayRedbox(` + { + "description": "Next.js navigation API is not allowed to be used in Middleware.", + "environmentLabel": null, + "label": "Runtime Error", + "source": "middleware.ts (8:13) @ middleware + > 8 | redirect('/') + | ^", + "stack": [ + "middleware middleware.ts (8:13)", + ], + } + `) }) it('should error on navigation API not-found', async () => { const browser = await next.browser('/middleware/not-found') - // TODO(veil): investigate the column number is off by 1 between turbo and webpack - if (isTurbopack) { - await expect(browser).toDisplayRedbox(` - { - "description": "Next.js navigation API is not allowed to be used in Middleware.", - "environmentLabel": null, - "label": "Runtime Error", - "source": "middleware.ts (6:12) @ middleware - > 6 | notFound() - | ^", - "stack": [ - "middleware middleware.ts (6:12)", - ], - } - `) - } else { - await expect(browser).toDisplayRedbox(` - { - "description": "Next.js navigation API is not allowed to be used in Middleware.", - "environmentLabel": null, - "label": "Runtime Error", - "source": "middleware.ts (6:13) @ middleware - > 6 | notFound() - | ^", - "stack": [ - "middleware middleware.ts (6:13)", - ], - } - `) - } + await expect(browser).toDisplayRedbox(` + { + "description": "Next.js navigation API is not allowed to be used in Middleware.", + "environmentLabel": null, + "label": "Runtime Error", + "source": "middleware.ts (6:13) @ middleware + > 6 | notFound() + | ^", + "stack": [ + "middleware middleware.ts (6:13)", + ], + } + `) }) }) }) diff --git a/test/development/app-dir/use-cache-errors/use-cache-errors.test.ts b/test/development/app-dir/use-cache-errors/use-cache-errors.test.ts index fa450d56c7eec..27a845d4a001f 100644 --- a/test/development/app-dir/use-cache-errors/use-cache-errors.test.ts +++ b/test/development/app-dir/use-cache-errors/use-cache-errors.test.ts @@ -2,7 +2,7 @@ import { nextTestSetup } from 'e2e-utils' import { assertNoRedbox } from '../../../lib/next-test-utils' describe('use-cache-errors', () => { - const { isTurbopack, next } = nextTestSetup({ + const { next } = nextTestSetup({ files: __dirname, }) const isRspack = Boolean(process.env.NEXT_RSPACK) @@ -18,25 +18,7 @@ describe('use-cache-errors', () => { it('should show a runtime error when calling the incorrectly used cache function', async () => { const browser = await next.browser('/') await browser.elementById('action-button').click() - - if (isTurbopack) { - // TODO(veil): Inconsistent cursor position - await expect(browser).toDisplayRedbox(` - { - "description": "Attempted to call useStuff() from the server but useStuff is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.", - "environmentLabel": "Cache", - "label": "Runtime Error", - "source": "app/module-with-use-cache.ts (16:17) @ useCachedStuff - > 16 | return useStuff() - | ^", - "stack": [ - "", - "useCachedStuff app/module-with-use-cache.ts (16:17)", - "Page app/page.tsx (22:10)", - ], - } - `) - } else if (isRspack) { + if (isRspack) { // TODO: the source is missing and the stack leaks rspack internals await expect(browser).toDisplayRedbox(` { diff --git a/test/development/middleware-errors/index.test.ts b/test/development/middleware-errors/index.test.ts index 13d1049d759ed..5a43fb447baeb 100644 --- a/test/development/middleware-errors/index.test.ts +++ b/test/development/middleware-errors/index.test.ts @@ -35,16 +35,16 @@ describe('middleware - development errors', () => { isTurbopack ? '\n ⨯ Error: boom' + // TODO(veil): Sourcemap to original name i.e. "default" - '\n at __TURBOPACK__default__export__ (middleware.js:3:14)' + + '\n at __TURBOPACK__default__export__ (middleware.js:3:15)' + '\n 1 |' : '\n ⨯ Error: boom' + - '\n at default (middleware.js:3:14)' + + '\n at default (middleware.js:3:15)' + '\n 1 |' ) expect(stripAnsi(next.cliOutput)).toContain( '' + "\n> 3 | throw new Error('boom')" + - '\n | ^' + '\n | ^' ) }) @@ -117,19 +117,19 @@ describe('middleware - development errors', () => { expect(stripAnsi(next.cliOutput)).toContain( isTurbopack ? ' ⨯ unhandledRejection: Error: async boom!' + - '\n at throwError (middleware.js:4:14)' + + '\n at throwError (middleware.js:4:15)' + // TODO(veil): Sourcemap to original name i.e. "default" - '\n at __TURBOPACK__default__export__ (middleware.js:7:8)' + + '\n at __TURBOPACK__default__export__ (middleware.js:7:9)' + "\n 2 | import { NextResponse } from 'next/server'" : '\n ⨯ unhandledRejection: Error: async boom!' + - '\n at throwError (middleware.js:4:14)' + - '\n at default (middleware.js:7:8)' + + '\n at throwError (middleware.js:4:15)' + + '\n at default (middleware.js:7:9)' + "\n 2 | import { NextResponse } from 'next/server'" ) expect(stripAnsi(next.cliOutput)).toContain( '' + "\n> 4 | throw new Error('async boom!')" + - '\n | ^' + '\n | ^' ) }) @@ -172,15 +172,15 @@ describe('middleware - development errors', () => { expect(stripAnsi(next.cliOutput)).toContain( isTurbopack ? '\n ⨯ Error [ReferenceError]: test is not defined' + - '\n at eval (middleware.js:4:8)' + - '\n at (middleware.js:4:8)' + + '\n at eval (middleware.js:4:9)' + + '\n at (middleware.js:4:9)' + // TODO(veil): Should be sourcemapped '\n at __TURBOPACK__default__export__ (' : '\n ⨯ Error [ReferenceError]: test is not defined' + // TODO(veil): Redundant and not clickable '\n at eval (file://webpack-internal:///(middleware)/./middleware.js)' + - '\n at eval (middleware.js:4:8)' + - '\n at default (middleware.js:4:8)' + + '\n at eval (middleware.js:4:9)' + + '\n at default (middleware.js:4:9)' + "\n 2 | import { NextResponse } from 'next/server'" ) expect(stripAnsi(next.cliOutput)).toContain( @@ -191,7 +191,7 @@ describe('middleware - development errors', () => { '\n at __TURBOPACK__default__export__ (' : "\n ⚠ DynamicCodeEvaluationWarning: Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime" + '\nLearn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation' + - '\n at default (middleware.js:4:8)' + + '\n at default (middleware.js:4:9)' + "\n 2 | import { NextResponse } from 'next/server'" ) }) @@ -273,7 +273,7 @@ describe('middleware - development errors', () => { // TODO: Should be anonymous method without a method name '\n at (middleware.js:3)' + // TODO: Should be ignore-listed - '\n at eval (middleware.js:3:12)' + + '\n at eval (middleware.js:3:13)' + '\n at (middleware)/./middleware.js (.next/server/middleware.js:18:1)' + '\n at __webpack_require__ ' ) @@ -306,7 +306,7 @@ describe('middleware - development errors', () => { > 3 | throw new Error('booooom!') | ^", "stack": [ - " middleware.js (3:0)", + " middleware.js (3)", "eval middleware.js (3:13)", "", "", diff --git a/test/e2e/app-dir/dynamic-io-errors/dynamic-io-errors.test.ts b/test/e2e/app-dir/dynamic-io-errors/dynamic-io-errors.test.ts index 6461fc76cfcb6..f1232a8bf3316 100644 --- a/test/e2e/app-dir/dynamic-io-errors/dynamic-io-errors.test.ts +++ b/test/e2e/app-dir/dynamic-io-errors/dynamic-io-errors.test.ts @@ -240,7 +240,7 @@ describe('Dynamic IO Errors', () => { 333 | */ 334 | function InnerLayoutRouter({ > 335 | tree, - | ^ + | ^ 336 | segmentPath, 337 | cacheNode, 338 | url, @@ -632,14 +632,14 @@ describe('Dynamic IO Errors', () => { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` "Error: Route "/dynamic-root": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense - at IndirectionTwo (turbopack:///[project]/app/dynamic-root/indirection.tsx:7:33) + at IndirectionTwo (turbopack:///[project]/app/dynamic-root/indirection.tsx:7:34) at main () at body () at html () 5 | } 6 | > 7 | export function IndirectionTwo({ children }) { - | ^ + | ^ 8 | return children 9 | } 10 | @@ -657,13 +657,14 @@ describe('Dynamic IO Errors', () => { } else { expect(output).toMatchInlineSnapshot(` "Error: Route "/dynamic-root": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense - at c (turbopack:///[project]/app/dynamic-root/indirection.tsx:9:0) + at c (turbopack:///[project]/app/dynamic-root/indirection.tsx:9:1) at main () at body () at html () 7 | export function IndirectionTwo({ children }) { 8 | return children > 9 | } + | ^ 10 | To get a more detailed stack trace and pinpoint the issue, try one of the following: - Start the app in development mode by running \`next dev\`, then open "/dynamic-root" in your browser to investigate the error. @@ -683,7 +684,7 @@ describe('Dynamic IO Errors', () => { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` "Error: Route "/dynamic-root": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense - at IndirectionTwo (webpack:///app/dynamic-root/indirection.tsx:7:33) + at IndirectionTwo (webpack:///app/dynamic-root/indirection.tsx:7:34) at InnerLayoutRouter (webpack://) at RedirectErrorBoundary (webpack://) at RedirectBoundary (webpack://) @@ -711,7 +712,7 @@ describe('Dynamic IO Errors', () => { 5 | } 6 | > 7 | export function IndirectionTwo({ children }) { - | ^ + | ^ 8 | return children 9 | } 10 | @@ -744,7 +745,7 @@ describe('Dynamic IO Errors', () => { 333 | */ 334 | function InnerLayoutRouter({ > 335 | tree, - | ^ + | ^ 336 | segmentPath, 337 | cacheNode, 338 | url, @@ -923,12 +924,12 @@ describe('Dynamic IO Errors', () => { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` "Error: Route "/sync-random-without-fallback" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random - at getRandomNumber (turbopack:///[project]/app/sync-random-without-fallback/page.tsx:32:14) - at RandomReadingComponent (turbopack:///[project]/app/sync-random-without-fallback/page.tsx:40:17) + at getRandomNumber (turbopack:///[project]/app/sync-random-without-fallback/page.tsx:32:15) + at RandomReadingComponent (turbopack:///[project]/app/sync-random-without-fallback/page.tsx:40:18) 30 | 31 | function getRandomNumber() { > 32 | return Math.random() - | ^ + | ^ 33 | } 34 | 35 | function RandomReadingComponent() { @@ -941,11 +942,11 @@ describe('Dynamic IO Errors', () => { } else { expect(output).toMatchInlineSnapshot(` "Error: Route "/sync-random-without-fallback" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random - at f (turbopack:///[project]/app/sync-random-without-fallback/page.tsx:32:14) + at f (turbopack:///[project]/app/sync-random-without-fallback/page.tsx:32:15) 30 | 31 | function getRandomNumber() { > 32 | return Math.random() - | ^ + | ^ 33 | } 34 | 35 | function RandomReadingComponent() { @@ -960,12 +961,12 @@ describe('Dynamic IO Errors', () => { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` "Error: Route "/sync-random-without-fallback" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random - at getRandomNumber (webpack:///app/sync-random-without-fallback/page.tsx:32:14) - at RandomReadingComponent (webpack:///app/sync-random-without-fallback/page.tsx:40:17) + at getRandomNumber (webpack:///app/sync-random-without-fallback/page.tsx:32:15) + at RandomReadingComponent (webpack:///app/sync-random-without-fallback/page.tsx:40:18) 30 | 31 | function getRandomNumber() { > 32 | return Math.random() - | ^ + | ^ 33 | } 34 | 35 | function RandomReadingComponent() { @@ -1184,12 +1185,12 @@ describe('Dynamic IO Errors', () => { expect(output).toMatchInlineSnapshot(` "Error occurred prerendering page "/sync-cookies". Read more: https://nextjs.org/docs/messages/prerender-error TypeError: ().get is not a function - at CookiesReadingComponent (turbopack:///[project]/app/sync-cookies/page.tsx:17:66) + at CookiesReadingComponent (turbopack:///[project]/app/sync-cookies/page.tsx:17:67) at stringify () 15 | 16 | async function CookiesReadingComponent() { > 17 | const _token = (cookies() as unknown as UnsafeUnwrappedCookies).get('token') - | ^ + | ^ 18 | return
    this component reads the \`token\` cookie synchronously
    19 | } 20 | { @@ -1203,12 +1204,12 @@ describe('Dynamic IO Errors', () => { expect(output).toMatchInlineSnapshot(` "Error occurred prerendering page "/sync-cookies". Read more: https://nextjs.org/docs/messages/prerender-error TypeError: ().get is not a function - at e (turbopack:///[project]/app/sync-cookies/page.tsx:17:66) + at e (turbopack:///[project]/app/sync-cookies/page.tsx:17:67) at a () 15 | 16 | async function CookiesReadingComponent() { > 17 | const _token = (cookies() as unknown as UnsafeUnwrappedCookies).get('token') - | ^ + | ^ 18 | return
    this component reads the \`token\` cookie synchronously
    19 | } 20 | { @@ -1222,12 +1223,12 @@ describe('Dynamic IO Errors', () => { expect(output).toMatchInlineSnapshot(` "Error occurred prerendering page "/sync-cookies". Read more: https://nextjs.org/docs/messages/prerender-error TypeError: ().get is not a function - at CookiesReadingComponent (webpack:///app/sync-cookies/page.tsx:17:66) + at CookiesReadingComponent (webpack:///app/sync-cookies/page.tsx:17:67) at stringify () 15 | 16 | async function CookiesReadingComponent() { > 17 | const _token = (cookies() as unknown as UnsafeUnwrappedCookies).get('token') - | ^ + | ^ 18 | return
    this component reads the \`token\` cookie synchronously
    19 | } 20 | { @@ -1409,12 +1410,12 @@ describe('Dynamic IO Errors', () => { expect(output).toMatchInlineSnapshot(` "Error occurred prerendering page "/sync-headers". Read more: https://nextjs.org/docs/messages/prerender-error TypeError: ().get is not a function - at HeadersReadingComponent (turbopack:///[project]/app/sync-headers/page.tsx:17:69) + at HeadersReadingComponent (turbopack:///[project]/app/sync-headers/page.tsx:17:70) at stringify () 15 | 16 | async function HeadersReadingComponent() { > 17 | const userAgent = (headers() as unknown as UnsafeUnwrappedHeaders).get( - | ^ + | ^ 18 | 'user-agent' 19 | ) 20 | return ( { @@ -1428,12 +1429,12 @@ describe('Dynamic IO Errors', () => { expect(output).toMatchInlineSnapshot(` "Error occurred prerendering page "/sync-headers". Read more: https://nextjs.org/docs/messages/prerender-error TypeError: ().get is not a function - at e (turbopack:///[project]/app/sync-headers/page.tsx:17:69) + at e (turbopack:///[project]/app/sync-headers/page.tsx:17:70) at a () 15 | 16 | async function HeadersReadingComponent() { > 17 | const userAgent = (headers() as unknown as UnsafeUnwrappedHeaders).get( - | ^ + | ^ 18 | 'user-agent' 19 | ) 20 | return ( { @@ -1447,12 +1448,12 @@ describe('Dynamic IO Errors', () => { expect(output).toMatchInlineSnapshot(` "Error occurred prerendering page "/sync-headers". Read more: https://nextjs.org/docs/messages/prerender-error TypeError: ().get is not a function - at HeadersReadingComponent (webpack:///app/sync-headers/page.tsx:17:69) + at HeadersReadingComponent (webpack:///app/sync-headers/page.tsx:17:70) at stringify () 15 | 16 | async function HeadersReadingComponent() { > 17 | const userAgent = (headers() as unknown as UnsafeUnwrappedHeaders).get( - | ^ + | ^ 18 | 'user-agent' 19 | ) 20 | return ( { @@ -1662,11 +1663,11 @@ describe('Dynamic IO Errors', () => { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` "Error: Route "/sync-attribution/guarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client - at SyncIO (turbopack:///[project]/app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:5:15) + at SyncIO (turbopack:///[project]/app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:5:16) 3 | export function SyncIO() { 4 | // This is a sync IO access that should not cause an error > 5 | const data = new Date().toISOString() - | ^ + | ^ 6 | 7 | return ( 8 |
    @@ -1679,11 +1680,11 @@ describe('Dynamic IO Errors', () => { } else { expect(output).toMatchInlineSnapshot(` "Error: Route "/sync-attribution/guarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client - at c (turbopack:///[project]/app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:9:6) + at c (turbopack:///[project]/app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:9:7) 7 | return ( 8 |
    > 9 |

    Sync IO Access

    - | ^ + | ^ 10 |

    Current date and time: {data}

    11 |
    12 | ) @@ -1698,11 +1699,11 @@ describe('Dynamic IO Errors', () => { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` "Error: Route "/sync-attribution/guarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client - at SyncIO (webpack:///app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:5:15) + at SyncIO (webpack:///app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:5:16) 3 | export function SyncIO() { 4 | // This is a sync IO access that should not cause an error > 5 | const data = new Date().toISOString() - | ^ + | ^ 6 | 7 | return ( 8 |
    @@ -1745,11 +1746,11 @@ describe('Dynamic IO Errors', () => { "description": "Route "/sync-attribution/unguarded-async-guarded-clientsync": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense", "environmentLabel": "Server", "label": "Console Error", - "source": "app/sync-attribution/unguarded-async-guarded-clientsync/page.tsx (34:17) @ RequestData + "source": "app/sync-attribution/unguarded-async-guarded-clientsync/page.tsx (34:18) @ RequestData > 34 | ;(await cookies()).get('foo') - | ^", + | ^", "stack": [ - "RequestData app/sync-attribution/unguarded-async-guarded-clientsync/page.tsx (34:17)", + "RequestData app/sync-attribution/unguarded-async-guarded-clientsync/page.tsx (34:18)", "Page app/sync-attribution/unguarded-async-guarded-clientsync/page.tsx (27:9)", "LogSafely ", ], @@ -1865,7 +1866,7 @@ describe('Dynamic IO Errors', () => { 333 | */ 334 | function InnerLayoutRouter({ > 335 | tree, - | ^ + | ^ 336 | segmentPath, 337 | cacheNode, 338 | url, @@ -1971,11 +1972,11 @@ describe('Dynamic IO Errors', () => { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` "Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client - at SyncIO (turbopack:///[project]/app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:5:15) + at SyncIO (turbopack:///[project]/app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:5:16) 3 | export function SyncIO() { 4 | // This is a sync IO access that should not cause an error > 5 | const data = new Date().toISOString() - | ^ + | ^ 6 | 7 | return ( 8 |
    @@ -1988,11 +1989,11 @@ describe('Dynamic IO Errors', () => { } else { expect(output).toMatchInlineSnapshot(` "Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client - at c (turbopack:///[project]/app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:9:6) + at c (turbopack:///[project]/app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:9:7) 7 | return ( 8 |
    > 9 |

    Sync IO Access

    - | ^ + | ^ 10 |

    Current date and time: {data}

    11 |
    12 | ) @@ -2007,11 +2008,11 @@ describe('Dynamic IO Errors', () => { if (isDebugPrerender) { expect(output).toMatchInlineSnapshot(` "Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client - at SyncIO (webpack:///app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:5:15) + at SyncIO (webpack:///app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:5:16) 3 | export function SyncIO() { 4 | // This is a sync IO access that should not cause an error > 5 | const data = new Date().toISOString() - | ^ + | ^ 6 | 7 | return ( 8 |
    diff --git a/test/e2e/app-dir/dynamic-io/dynamic-io.console.test.ts b/test/e2e/app-dir/dynamic-io/dynamic-io.console.test.ts index f50e14ce39a4d..9822be68d7d06 100644 --- a/test/e2e/app-dir/dynamic-io/dynamic-io.console.test.ts +++ b/test/e2e/app-dir/dynamic-io/dynamic-io.console.test.ts @@ -33,11 +33,11 @@ describe('dynamic-io', () => { /console: This is a console page /console: not a template { foo: 'just-some-object' } Error: /console: test - at ConsolePage (app/console/page.tsx:5:16) + at ConsolePage (app/console/page.tsx:5:17)   3 | console.log('/console: This is a console page')  4 | console.warn('/console: not a template', { foo: 'just-some-object' }) > 5 | console.error(new Error('/console: test')) -  | ^ +  | ^  6 | console.assert(  7 | false,  8 | '/console: This is an assert message with a %s', @@ -46,11 +46,11 @@ describe('dynamic-io', () => { /console: This is a console page /console: not a template { foo: 'just-some-object' } Error: /console: test - at ConsolePage (app/console/page.tsx:5:16) + at ConsolePage (app/console/page.tsx:5:17) 3 | console.log('/console: This is a console page') 4 | console.warn('/console: not a template', { foo: 'just-some-object' }) > 5 | console.error(new Error('/console: test')) - | ^ + | ^ 6 | console.assert( 7 | false, 8 | '/console: This is an assert message with a %s', @@ -59,11 +59,11 @@ describe('dynamic-io', () => { /console: This is a console page /console: not a template { foo: 'just-some-object' } Error: /console: test - at ConsolePage (app/console/page.tsx:5:16) + at ConsolePage (app/console/page.tsx:5:17) 3 | console.log('/console: This is a console page') 4 | console.warn('/console: not a template', { foo: 'just-some-object' }) > 5 | console.error(new Error('/console: test')) - | ^ + | ^ 6 | console.assert( 7 | false, 8 | '/console: This is an assert message with a %s', diff --git a/test/e2e/app-dir/server-source-maps/server-source-maps-edge.test.ts b/test/e2e/app-dir/server-source-maps/server-source-maps-edge.test.ts index 61ec4cc12223a..b41ee3dfabf7b 100644 --- a/test/e2e/app-dir/server-source-maps/server-source-maps-edge.test.ts +++ b/test/e2e/app-dir/server-source-maps/server-source-maps-edge.test.ts @@ -30,11 +30,11 @@ describe('app-dir - server source maps edge runtime', () => { }) expect(normalizeCliOutput(next.cliOutput.slice(outputIndex))).toContain( '\nError: rsc-error-log' + - '\n at logError (app/rsc-error-log/page.js:2:16)' + - '\n at Page (app/rsc-error-log/page.js:6:2)' + + '\n at logError (app/rsc-error-log/page.js:2:17)' + + '\n at Page (app/rsc-error-log/page.js:6:3)' + '\n 1 | function logError() {' + "\n> 2 | console.error(new Error('rsc-error-log'))" + - '\n | ^' + + '\n | ^' + '\n 3 | }' + '\n 4 |' + '\n 5 | export default function Page() { {' + @@ -59,12 +59,12 @@ describe('app-dir - server source maps edge runtime', () => { const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex)) expect(cliOutput).toContain( '\n ⨯ Error: ssr-throw' + - '\n at throwError (app/ssr-throw/page.js:4:8)' + - '\n at Page (app/ssr-throw/page.js:8:2)' + + '\n at throwError (app/ssr-throw/page.js:4:9)' + + '\n at Page (app/ssr-throw/page.js:8:3)' + '\n 2 |' + '\n 3 | function throwError() {' + "\n> 4 | throw new Error('ssr-throw')" + - '\n | ^' + + '\n | ^' + '\n 5 | }' + '\n 6 |' + '\n 7 | export default function Page() { {' + @@ -89,11 +89,11 @@ describe('app-dir - server source maps edge runtime', () => { const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex)) expect(cliOutput).toContain( '\n ⨯ Error: rsc-throw' + - '\n at throwError (app/rsc-throw/page.js:2:8)' + - '\n at Page (app/rsc-throw/page.js:6:2)' + + '\n at throwError (app/rsc-throw/page.js:2:9)' + + '\n at Page (app/rsc-throw/page.js:6:3)' + '\n 1 | function throwError() {' + "\n> 2 | throw new Error('rsc-throw')" + - '\n | ^' + + '\n | ^' + '\n 3 | }' + '\n 4 |' + '\n 5 | export default function Page() { {' + diff --git a/test/e2e/app-dir/server-source-maps/server-source-maps.test.ts b/test/e2e/app-dir/server-source-maps/server-source-maps.test.ts index 48fc74efed536..93128320d4b39 100644 --- a/test/e2e/app-dir/server-source-maps/server-source-maps.test.ts +++ b/test/e2e/app-dir/server-source-maps/server-source-maps.test.ts @@ -42,12 +42,12 @@ describe('app-dir - server source maps', () => { }) expect(normalizeCliOutput(next.cliOutput.slice(outputIndex))).toContain( '\nError: rsc-error-log' + - '\n at logError (app/rsc-error-log/page.js:4:16)' + - '\n at Page (app/rsc-error-log/page.js:9:2)' + + '\n at logError (app/rsc-error-log/page.js:4:17)' + + '\n at Page (app/rsc-error-log/page.js:9:3)' + '\n 2 |' + '\n 3 | function logError() {' + "\n> 4 | const error = new Error('rsc-error-log')" + - '\n | ^' + + '\n | ^' + '\n 5 | console.error(error)' + '\n 6 | }' + '\n 7 |' + @@ -58,12 +58,12 @@ describe('app-dir - server source maps', () => { // TODO(veil): Sourcemap names // TODO(veil): relative paths expect(normalizeCliOutput(next.cliOutput)).toContain( - '(bundler:///app/rsc-error-log/page.js:4:16)' + '(bundler:///app/rsc-error-log/page.js:4:17)' ) expect(normalizeCliOutput(next.cliOutput)).toContain( '' + "\n> 4 | const error = new Error('rsc-error-log')" + - '\n | ^' + '\n | ^' ) } else { // TODO(veil): line/column numbers are flaky in Webpack @@ -83,20 +83,20 @@ describe('app-dir - server source maps', () => { }) expect(normalizeCliOutput(next.cliOutput.slice(outputIndex))).toContain( '\nError: rsc-error-log-cause' + - '\n at logError (app/rsc-error-log-cause/page.js:2:16)' + - '\n at Page (app/rsc-error-log-cause/page.js:8:2)' + + '\n at logError (app/rsc-error-log-cause/page.js:2:17)' + + '\n at Page (app/rsc-error-log-cause/page.js:8:3)' + '\n 1 | function logError(cause) {' + "\n> 2 | const error = new Error('rsc-error-log-cause', { cause })" + - '\n | ^' + + '\n | ^' + '\n 3 | console.error(error)' + '\n 4 | }' + '\n 5 | {' + '\n [cause]: Error: Boom' + - '\n at Page (app/rsc-error-log-cause/page.js:7:16)' + + '\n at Page (app/rsc-error-log-cause/page.js:7:17)' + '\n 5 |' + '\n 6 | export default function Page() {' + "\n > 7 | const error = new Error('Boom')" + - '\n | ^' + + '\n | ^' + '\n 8 | logError(error)' + '\n 9 | return null' + '\n 10 | }' + @@ -107,20 +107,20 @@ describe('app-dir - server source maps', () => { // TODO(veil): Sourcemap names // TODO(veil): relative paths expect(normalizeCliOutput(next.cliOutput)).toContain( - '(bundler:///app/rsc-error-log-cause/page.js:2:16)' + '(bundler:///app/rsc-error-log-cause/page.js:2:17)' ) expect(normalizeCliOutput(next.cliOutput)).toContain( - '(bundler:///app/rsc-error-log-cause/page.js:7:16)' + '(bundler:///app/rsc-error-log-cause/page.js:7:17)' ) expect(normalizeCliOutput(next.cliOutput)).toContain( '' + "\n> 2 | const error = new Error('rsc-error-log-cause', { cause })" + - '\n | ^' + '\n | ^' ) expect(normalizeCliOutput(next.cliOutput)).toContain( '' + "\n > 7 | const error = new Error('Boom')" + - '\n | ^' + '\n | ^' ) } else { // TODO(veil): line/column numbers are flaky in Webpack @@ -141,37 +141,37 @@ describe('app-dir - server source maps', () => { expect(normalizeCliOutput(next.cliOutput.slice(outputIndex))).toContain( isTurbopack ? '\nError: ssr-error-log-ignore-listed' + - '\n at logError (app/ssr-error-log-ignore-listed/page.js:9:16)' + - '\n at runWithInternalIgnored (app/ssr-error-log-ignore-listed/page.js:19:12)' + + '\n at logError (app/ssr-error-log-ignore-listed/page.js:9:17)' + + '\n at runWithInternalIgnored (app/ssr-error-log-ignore-listed/page.js:19:13)' + '\n at runWithExternalSourceMapped (app/ssr-error-log-ignore-listed/page.js:18:29)' + '\n at runWithExternal (app/ssr-error-log-ignore-listed/page.js:17:32)' + '\n at runWithInternalSourceMapped (app/ssr-error-log-ignore-listed/page.js:16:18)' + // Realpath does not point into node_modules so we don't ignore it. // TODO(veil): Should be internal-pkg/sourcemapped.ts - '\n at runInternalSourceMapped (sourcemapped.ts:5:9)' + + '\n at runInternalSourceMapped (sourcemapped.ts:5:10)' + '\n at runWithInternal (app/ssr-error-log-ignore-listed/page.js:15:28)' + // Realpath does not point into node_modules so we don't ignore it. - '\n at runInternal (internal-pkg/index.js:2:9)' + + '\n at runInternal (internal-pkg/index.js:2:10)' + '\n at Page (app/ssr-error-log-ignore-listed/page.js:14:14)' + '\n 7 |' + '\n' : '\nError: ssr-error-log-ignore-listed' + - '\n at logError (app/ssr-error-log-ignore-listed/page.js:9:16)' + - '\n at runWithInternalIgnored (app/ssr-error-log-ignore-listed/page.js:19:12)' + + '\n at logError (app/ssr-error-log-ignore-listed/page.js:9:17)' + + '\n at runWithInternalIgnored (app/ssr-error-log-ignore-listed/page.js:19:13)' + // TODO(veil-NDX-910): Webpacks's sourcemap loader drops `ignoreList` // TODO(veil): Webpack's sourcemap loader creates an incorrect `sources` entry. // Can be worked around by using `./sourcemapped.ts` instead of `sourcemapped.ts`. - '\n at runInternalIgnored (webpack-internal:/(ssr)/internal-pkg/ignored.ts:6:9)' + + '\n at runInternalIgnored (webpack-internal:/(ssr)/internal-pkg/ignored.ts:6:10)' + '\n at runWithExternalSourceMapped (app/ssr-error-log-ignore-listed/page.js:18:29)' + '\n at runWithExternal (app/ssr-error-log-ignore-listed/page.js:17:32)' + '\n at runWithInternalSourceMapped (app/ssr-error-log-ignore-listed/page.js:16:18)' + // TODO(veil): Webpack's sourcemap loader creates an incorrect `sources` entry. // Can be worked around by using `./sourcemapped.ts` instead of `sourcemapped.ts`. // Realpath does not point into node_modules so we don't ignore it. - '\n at runInternalSourceMapped (webpack-internal:/(ssr)/internal-pkg/sourcemapped.ts:5:9)' + + '\n at runInternalSourceMapped (webpack-internal:/(ssr)/internal-pkg/sourcemapped.ts:5:10)' + '\n at runWithInternal (app/ssr-error-log-ignore-listed/page.js:15:28)' + // Realpath does not point into node_modules so we don't ignore it. - '\n at runInternal (internal-pkg/index.js:2:9)' + + '\n at runInternal (internal-pkg/index.js:2:10)' + '\n at Page (app/ssr-error-log-ignore-listed/page.js:14:14)' + '\n 7 |' + '\n' @@ -191,14 +191,14 @@ describe('app-dir - server source maps', () => { "logError app/ssr-error-log-ignore-listed/page.js (9:17)", "runWithInternalIgnored app/ssr-error-log-ignore-listed/page.js (19:13)", "", - "runWithExternalSourceMapped app/ssr-error-log-ignore-listed/page.js (18:28)", + "runWithExternalSourceMapped app/ssr-error-log-ignore-listed/page.js (18:29)", "", - "runWithExternal app/ssr-error-log-ignore-listed/page.js (17:31)", - "runWithInternalSourceMapped app/ssr-error-log-ignore-listed/page.js (16:17)", + "runWithExternal app/ssr-error-log-ignore-listed/page.js (17:32)", + "runWithInternalSourceMapped app/ssr-error-log-ignore-listed/page.js (16:18)", "", - "runWithInternal app/ssr-error-log-ignore-listed/page.js (15:27)", + "runWithInternal app/ssr-error-log-ignore-listed/page.js (15:28)", "runInternal internal-pkg/index.js (2:10)", - "Page app/ssr-error-log-ignore-listed/page.js (14:13)", + "Page app/ssr-error-log-ignore-listed/page.js (14:14)", ], } `) @@ -234,10 +234,10 @@ describe('app-dir - server source maps', () => { // TODO(veil): Sourcemap names // TODO(veil): relative paths expect(normalizeCliOutput(next.cliOutput)).toContain( - '(bundler:///app/ssr-error-log-ignore-listed/page.js:24:2)' + '(bundler:///app/ssr-error-log-ignore-listed/page.js:23:5)' ) expect(normalizeCliOutput(next.cliOutput)).toContain( - '\n> 24 | })\n | ^' + '\n> 23 | })\n | ^' ) } else { // TODO(veil): line/column numbers are flaky in Webpack @@ -258,37 +258,37 @@ describe('app-dir - server source maps', () => { expect(normalizeCliOutput(next.cliOutput.slice(outputIndex))).toContain( isTurbopack ? '\nError: rsc-error-log-ignore-listed' + - '\n at logError (app/rsc-error-log-ignore-listed/page.js:8:16)' + - '\n at runWithInternalIgnored (app/rsc-error-log-ignore-listed/page.js:18:12)' + + '\n at logError (app/rsc-error-log-ignore-listed/page.js:8:17)' + + '\n at runWithInternalIgnored (app/rsc-error-log-ignore-listed/page.js:18:13)' + '\n at runWithExternalSourceMapped (app/rsc-error-log-ignore-listed/page.js:17:29)' + '\n at runWithExternal (app/rsc-error-log-ignore-listed/page.js:16:32)' + '\n at runWithInternalSourceMapped (app/rsc-error-log-ignore-listed/page.js:15:18)' + // Realpath does not point into node_modules so we don't ignore it. // TODO(veil): Should be internal-pkg/sourcemapped.ts - '\n at runInternalSourceMapped (sourcemapped.ts:5:9)' + + '\n at runInternalSourceMapped (sourcemapped.ts:5:10)' + '\n at runWithInternal (app/rsc-error-log-ignore-listed/page.js:14:28)' + // Realpath does not point into node_modules so we don't ignore it. - '\n at runInternal (internal-pkg/index.js:2:9)' + + '\n at runInternal (internal-pkg/index.js:2:10)' + '\n at Page (app/rsc-error-log-ignore-listed/page.js:13:14)' + '\n 6 |' + '\n' : '\nError: rsc-error-log-ignore-listed' + - '\n at logError (app/rsc-error-log-ignore-listed/page.js:8:16)' + - '\n at runWithInternalIgnored (app/rsc-error-log-ignore-listed/page.js:18:12)' + + '\n at logError (app/rsc-error-log-ignore-listed/page.js:8:17)' + + '\n at runWithInternalIgnored (app/rsc-error-log-ignore-listed/page.js:18:13)' + // TODO(veil): Webpacks's sourcemap loader drops `ignoreList` // TODO(veil): Webpack's sourcemap loader creates an incorrect `sources` entry. // Can be worked around by using `./sourcemapped.ts` instead of `sourcemapped.ts`. - '\n at runInternalIgnored (webpack-internal:/(rsc)/internal-pkg/ignored.ts:6:9)' + + '\n at runInternalIgnored (webpack-internal:/(rsc)/internal-pkg/ignored.ts:6:10)' + '\n at runWithExternalSourceMapped (app/rsc-error-log-ignore-listed/page.js:17:29)' + '\n at runWithExternal (app/rsc-error-log-ignore-listed/page.js:16:32)' + '\n at runWithInternalSourceMapped (app/rsc-error-log-ignore-listed/page.js:15:18)' + // TODO(veil): Webpack's sourcemap loader creates an incorrect `sources` entry. // Can be worked around by using `./sourcemapped.ts` instead of `sourcemapped.ts`. // Realpath does not point into node_modules so we don't ignore it. - '\n at runInternalSourceMapped (webpack-internal:/(rsc)/internal-pkg/sourcemapped.ts:5:9)' + + '\n at runInternalSourceMapped (webpack-internal:/(rsc)/internal-pkg/sourcemapped.ts:5:10)' + '\n at runWithInternal (app/rsc-error-log-ignore-listed/page.js:14:28)' + // Realpath does not point into node_modules so we don't ignore it. - '\n at runInternal (internal-pkg/index.js:2:9)' + + '\n at runInternal (internal-pkg/index.js:2:10)' + '\n at Page (app/rsc-error-log-ignore-listed/page.js:13:14)' + '\n 6 |' + '\n' @@ -298,12 +298,12 @@ describe('app-dir - server source maps', () => { // TODO(veil): Sourcemap names // TODO(veil): relative paths expect(normalizeCliOutput(next.cliOutput)).toContain( - 'at (bundler:///app/rsc-error-log-ignore-listed/page.js:8:16)' + 'at (bundler:///app/rsc-error-log-ignore-listed/page.js:8:17)' ) expect(normalizeCliOutput(next.cliOutput)).toContain( '' + "\n> 8 | const error = new Error('rsc-error-log-ignore-listed')" + - '\n | ^' + '\n | ^' ) } else { // TODO(veil): line/column numbers are flaky in Webpack @@ -323,12 +323,12 @@ describe('app-dir - server source maps', () => { const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex)) expect(cliOutput).toContain( '\n ⨯ Error: ssr-throw' + - '\n at throwError (app/ssr-throw/Thrower.js:4:8)' + - '\n at Thrower (app/ssr-throw/Thrower.js:8:2)' + + '\n at throwError (app/ssr-throw/Thrower.js:4:9)' + + '\n at Thrower (app/ssr-throw/Thrower.js:8:3)' + '\n 2 |' + '\n 3 | function throwError() {' + "\n> 4 | throw new Error('ssr-throw')" + - '\n | ^' + + '\n | ^' + '\n 5 | }' + '\n 6 |' + '\n 7 | export function Thrower() { {' + @@ -396,8 +396,8 @@ describe('app-dir - server source maps', () => { // Node.js is fine with invalid URLs in index maps apparently. '' + '\nError: bad-sourcemap' + - '\n at logError (custom://[badhost]/app/bad-sourcemap/page.js:6:16)' + - '\n at Page (custom://[badhost]/app/bad-sourcemap/page.js:10:2)' + + '\n at logError (custom://[badhost]/app/bad-sourcemap/page.js:6:17)' + + '\n at Page (custom://[badhost]/app/bad-sourcemap/page.js:10:3)' + // TODO: Remove blank line '\n' ) @@ -446,9 +446,9 @@ describe('app-dir - server source maps', () => { '' + '\nError: module-evaluation' + // TODO(veil): Should map to no name like you'd get with native stacks without a bundler. - '\n at [project]/app/module-evaluation/module.js [app-rsc] (ecmascript) (app/module-evaluation/module.js:1:21)' + + '\n at [project]/app/module-evaluation/module.js [app-rsc] (ecmascript) (app/module-evaluation/module.js:1:22)' + // TODO(veil): Added frames from bundler should be sourcemapped (https://linear.app/vercel/issue/NDX-509/) - '\n at [project]/app/module-evaluation/page.js [app-rsc] (ecmascript) (app/module-evaluation/page.js:1:0)' + + '\n at [project]/app/module-evaluation/page.js [app-rsc] (ecmascript) (app/module-evaluation/page.js:1:1)' + '\n at [project]/app/module-evaluation/page.js [app-rsc] (ecmascript, Next.js Server Component) (.next' ) } else { @@ -457,7 +457,7 @@ describe('app-dir - server source maps', () => { '\nError: module-evaluation' + // TODO(veil): Should map to no name like you'd get with native stacks without a bundler. // TODO(veil): Location should be sourcemapped - '\n at eval (app/module-evaluation/module.js:1:21)' + + '\n at eval (app/module-evaluation/module.js:1:22)' + // TODO(veil): Added frames from bundler should be sourcemapped (https://linear.app/vercel/issue/NDX-509/) '\n at (rsc)/.' ) @@ -466,7 +466,7 @@ describe('app-dir - server source maps', () => { expect(cliOutput).toContain( '' + "\n> 1 | export const error = new Error('module-evaluation')" + - '\n | ^' + '\n | ^' ) if (isTurbopack) { @@ -516,14 +516,14 @@ describe('app-dir - server source maps', () => { ).toContain( '' + '\nError: module-evaluation' + - '\n at (bundler:///app/module-evaluation/module.js:1:21)' + + '\n at (bundler:///app/module-evaluation/module.js:1:22)' + // TODO(veil): Turbopack internals. Feel free to update. Tracked in https://linear.app/vercel/issue/NEXT-4362 '\n at Object.' ) expect(normalizeCliOutput(next.cliOutput)).toContain( '' + "\n> 1 | export const error = new Error('module-evaluation')" + - '\n | ^' + '\n | ^' ) } else { expect( @@ -650,9 +650,9 @@ describe('app-dir - server source maps', () => { "description": "ssr-anonymous-stack-frame-sandwich: external", "environmentLabel": null, "label": "Console Error", - "source": "app/ssr-anonymous-stack-frame-sandwich/page.js (6:28) @ Page + "source": "app/ssr-anonymous-stack-frame-sandwich/page.js (6:29) @ Page > 6 | runHiddenSetOfSetsExternal('ssr-anonymous-stack-frame-sandwich: external') - | ^", + | ^", "stack": [ "", "", @@ -661,16 +661,16 @@ describe('app-dir - server source maps', () => { "Set.forEach ", "", "", - "Page app/ssr-anonymous-stack-frame-sandwich/page.js (6:28)", + "Page app/ssr-anonymous-stack-frame-sandwich/page.js (6:29)", ], }, { "description": "ignore-listed frames", "environmentLabel": null, "label": "Console Error", - "source": "app/ssr-anonymous-stack-frame-sandwich/page.js (7:28) @ Page + "source": "app/ssr-anonymous-stack-frame-sandwich/page.js (7:29) @ Page > 7 | runHiddenSetOfSetsInternal('ssr-anonymous-stack-frame-sandwich: internal') - | ^", + | ^", "stack": [ "", "", @@ -679,7 +679,7 @@ describe('app-dir - server source maps', () => { "Set.forEach ", "", "", - "Page app/ssr-anonymous-stack-frame-sandwich/page.js (7:28)", + "Page app/ssr-anonymous-stack-frame-sandwich/page.js (7:29)", ], }, ] diff --git a/test/e2e/app-dir/use-cache-close-over-function/use-cache-close-over-function.test.ts b/test/e2e/app-dir/use-cache-close-over-function/use-cache-close-over-function.test.ts index 2be185d1e0553..0dda630d589e8 100644 --- a/test/e2e/app-dir/use-cache-close-over-function/use-cache-close-over-function.test.ts +++ b/test/e2e/app-dir/use-cache-close-over-function/use-cache-close-over-function.test.ts @@ -48,32 +48,19 @@ describe('use-cache-close-over-function', () => { const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex)) expect(cliOutput).toContain( - isTurbopack - ? 'Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' + - '\n [function fn]' + - '\n ^^^^^^^^^^^' + - '\n at createCachedFn (app/client/page.tsx:8:2)' + - '\n at Page (app/client/page.tsx:15:27)' + - '\n 6 | }' + - '\n 7 |' + - '\n> 8 | return async () => {' + - '\n | ^' + - "\n 9 | 'use cache'" + - '\n 10 | return Math.random() + fn()' + - '\n 11 | }' - : '' + - 'Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' + - '\n [function fn]' + - '\n ^^^^^^^^^^^' + - '\n at createCachedFn (app/client/page.tsx:8:2)' + - '\n at Page (app/client/page.tsx:15:27)' + - '\n 6 | }' + - '\n 7 |' + - '\n> 8 | return async () => {' + - '\n | ^' + - "\n 9 | 'use cache'" + - '\n 10 | return Math.random() + fn()' + - '\n 11 | }' + '' + + 'Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' + + '\n [function fn]' + + '\n ^^^^^^^^^^^' + + '\n at createCachedFn (app/client/page.tsx:8:3)' + + '\n at Page (app/client/page.tsx:15:28)' + + '\n 6 | }' + + '\n 7 |' + + '\n> 8 | return async () => {' + + '\n | ^' + + "\n 9 | 'use cache'" + + '\n 10 | return Math.random() + fn()' + + '\n 11 | }' ) }) @@ -111,22 +98,22 @@ describe('use-cache-close-over-function', () => { 'Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' + '\n [function fn]' + '\n ^^^^^^^^^^^' + - '\n at createCachedFn (app/server/page.tsx:6:2)' + + '\n at createCachedFn (app/server/page.tsx:6:3)' + // TODO(veil): Should be source-mapped. '\n at [project]' : '' + 'Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' + '\n [function fn]' + '\n ^^^^^^^^^^^' + - '\n at createCachedFn (app/server/page.tsx:6:2)' + - '\n at eval (app/server/page.tsx:12:23)' + + '\n at createCachedFn (app/server/page.tsx:6:3)' + + '\n at eval (app/server/page.tsx:12:24)' + // TODO(veil): Should be source-mapped. '\n at (rsc)' ) expect(cliOutput).toContain( '' + '\n> 6 | return async () => {' + - '\n | ^' + + '\n | ^' + "\n 7 | 'use cache'" ) }) diff --git a/test/e2e/app-dir/use-cache-hanging-inputs/use-cache-hanging-inputs.test.ts b/test/e2e/app-dir/use-cache-hanging-inputs/use-cache-hanging-inputs.test.ts index 5ed2ff8e4faf3..e97a31b9611a3 100644 --- a/test/e2e/app-dir/use-cache-hanging-inputs/use-cache-hanging-inputs.test.ts +++ b/test/e2e/app-dir/use-cache-hanging-inputs/use-cache-hanging-inputs.test.ts @@ -74,7 +74,7 @@ describe('use-cache-hanging-inputs', () => { `) expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} - at eval (app/search-params/page.tsx:3:15)`) + at eval (app/search-params/page.tsx:3:16)`) } }, 180_000) }) @@ -124,7 +124,7 @@ describe('use-cache-hanging-inputs', () => { `) expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} - at eval (app/search-params-caught/page.tsx:1:0)`) + at eval (app/search-params-caught/page.tsx:1:1)`) } }, 180_000) }) @@ -191,7 +191,7 @@ describe('use-cache-hanging-inputs', () => { `) expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} - at eval (app/uncached-promise/page.tsx:10:12)`) + at eval (app/uncached-promise/page.tsx:10:13)`) } }, 180_000) }) @@ -245,7 +245,7 @@ describe('use-cache-hanging-inputs', () => { `) expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} - at eval (app/uncached-promise-nested/page.tsx:16:0)`) + at eval (app/uncached-promise-nested/page.tsx:16:1)`) } }, 180_000) }) @@ -300,7 +300,7 @@ describe('use-cache-hanging-inputs', () => { `) expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} - at eval (app/bound-args/page.tsx:13:14)`) + at eval (app/bound-args/page.tsx:13:15)`) } }, 180_000) }) diff --git a/test/e2e/app-dir/use-cache-standalone-search-params/use-cache-standalone-search-params.test.ts b/test/e2e/app-dir/use-cache-standalone-search-params/use-cache-standalone-search-params.test.ts index 21d305d9414ce..ed9dea76025c5 100644 --- a/test/e2e/app-dir/use-cache-standalone-search-params/use-cache-standalone-search-params.test.ts +++ b/test/e2e/app-dir/use-cache-standalone-search-params/use-cache-standalone-search-params.test.ts @@ -92,7 +92,7 @@ describe('use-cache-standalone-search-params', () => { `) expect(cliOutput).toContain(`Error: ${expectedErrorMessage} - at Page (app/search-params-caught/page.tsx:11:4)`) + at Page (app/search-params-caught/page.tsx:11:5)`) }) it('should also show an error after the second reload', async () => { diff --git a/test/e2e/fetch-failures-have-good-stack-traces-in-edge-runtime/fetch-failures-have-good-stack-traces-in-edge-runtime.test.ts b/test/e2e/fetch-failures-have-good-stack-traces-in-edge-runtime/fetch-failures-have-good-stack-traces-in-edge-runtime.test.ts index 8aa90b0d65ea8..944d0c6bca44e 100644 --- a/test/e2e/fetch-failures-have-good-stack-traces-in-edge-runtime/fetch-failures-have-good-stack-traces-in-edge-runtime.test.ts +++ b/test/e2e/fetch-failures-have-good-stack-traces-in-edge-runtime/fetch-failures-have-good-stack-traces-in-edge-runtime.test.ts @@ -4,7 +4,7 @@ import { check } from 'next-test-utils' import stripAnsi from 'strip-ansi' describe('fetch failures have good stack traces in edge runtime', () => { - const { isTurbopack, next, isNextStart, isNextDev, skipped } = nextTestSetup({ + const { next, isNextStart, isNextDev, skipped } = nextTestSetup({ files: __dirname, // don't have access to runtime logs on deploy skipDeployment: true, @@ -31,36 +31,36 @@ describe('fetch failures have good stack traces in edge runtime', () => { expect(stripAnsi(next.cliOutput.slice(outputIndex))).toContain( '' + '\n ⨯ Error [TypeError]: fetch failed' + - '\n at anotherFetcher (src/fetcher.js:6:15)' + - '\n at fetcher (src/fetcher.js:2:15)' + + '\n at anotherFetcher (src/fetcher.js:6:16)' + + '\n at fetcher (src/fetcher.js:2:16)' + '\n at UnknownDomainEndpoint (pages/api/unknown-domain.js:6:16)' + '\n 4 |' + '\n 5 | async function anotherFetcher(...args) {' + '\n> 6 | return await fetch(...args)' + - '\n | ^' + + '\n | ^' + '\n 7 | }' + '\n 8 |' + // TODO(veil): Why double error? '\n ⨯ Error [TypeError]: fetch failed' ) - // TODO(veil): Why column off by one? + // Turbopack produces incorrect mappings in the sourcemap. // eslint-disable-next-line jest/no-standalone-expect await expect(browser).toDisplayRedbox(` - { - "description": "fetch failed", - "environmentLabel": null, - "label": "Runtime TypeError", - "source": "src/fetcher.js (6:16) @ anotherFetcher - > 6 | return await fetch(...args) - | ^", - "stack": [ - "anotherFetcher src/fetcher.js (6:16)", - "fetcher src/fetcher.js (2:16)", - "UnknownDomainEndpoint pages/api/unknown-domain.js (6:${isTurbopack ? 15 : 16})", - ], - } - `) + { + "description": "fetch failed", + "environmentLabel": null, + "label": "Runtime TypeError", + "source": "src/fetcher.js (6:16) @ anotherFetcher + > 6 | return await fetch(...args) + | ^", + "stack": [ + "anotherFetcher src/fetcher.js (6:16)", + "fetcher src/fetcher.js (2:16)", + "UnknownDomainEndpoint pages/api/unknown-domain.js (6:16)", + ], + } + `) } } ) diff --git a/test/integration/edge-runtime-dynamic-code/test/index.test.js b/test/integration/edge-runtime-dynamic-code/test/index.test.js index 6641e6ed29a46..6f899873e99aa 100644 --- a/test/integration/edge-runtime-dynamic-code/test/index.test.js +++ b/test/integration/edge-runtime-dynamic-code/test/index.test.js @@ -110,11 +110,11 @@ describe.each([ isTurbopack ? '' + // TODO(veil): Turbopack duplicates project path - '\n at usingEval (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/utils.js:11:16)' + - '\n at middleware (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/middleware.js:12:52)' + + '\n at usingEval (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/utils.js:11:17)' + + '\n at middleware (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/middleware.js:12:54)' + '\n 9 | export async function usingEval() {' - : '\n at usingEval (../../test/integration/edge-runtime-dynamic-code/lib/utils.js:11:18)' + - '\n at middleware (../../test/integration/edge-runtime-dynamic-code/middleware.js:12:53)' + + : '\n at usingEval (../../test/integration/edge-runtime-dynamic-code/lib/utils.js:11:19)' + + '\n at middleware (../../test/integration/edge-runtime-dynamic-code/middleware.js:12:54)' + // Next.js internal frame. Feel free to adjust. // Not ignore-listed because we're not in an isolated app and Next.js is symlinked so it's not in node_modules '\n at eval (../packages/next/dist' @@ -124,27 +124,27 @@ describe.each([ isTurbopack ? '' + // TODO(veil): Turbopack duplicates project path - '\n at usingEval (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/utils.js:11:16)' + - '\n at handler (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/pages/api/route.js:13:22)' + + '\n at usingEval (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/utils.js:11:17)' + + '\n at handler (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/pages/api/route.js:13:24)' + '\n 9 | export async function usingEval() {' - : '\n at usingEval (../../test/integration/edge-runtime-dynamic-code/lib/utils.js:11:18)' + - '\n at handler (../../test/integration/edge-runtime-dynamic-code/pages/api/route.js:13:23)' + + : '\n at usingEval (../../test/integration/edge-runtime-dynamic-code/lib/utils.js:11:19)' + + '\n at handler (../../test/integration/edge-runtime-dynamic-code/pages/api/route.js:13:24)' + '\n 9 | export async function usingEval() {' ) } - // TODO(veil): Inconsistent cursor position + // Turbopack produces incorrect mappings in the sourcemap. if (isTurbopack) { expect(output).toContain( '' + "\n> 11 | return { value: eval('100') }" + - '\n | ^' + '\n | ^' ) } else { expect(output).toContain( '' + "\n> 11 | return { value: eval('100') }" + - '\n | ^' + '\n | ^' ) } }) @@ -168,49 +168,52 @@ describe.each([ await waitFor(500) expect(output).toContain(WASM_COMPILE_ERROR) if (title === 'Middleware') { + // Turbopack produces incorrect mappings in the sourcemap. expect(output).toContain( isTurbopack ? '' + - '\n at usingWebAssemblyCompile (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/wasm.js:22:17)' + + '\n at usingWebAssemblyCompile (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/wasm.js:22:18)' + '\n at middleware (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/middleware.js:24:68)' + '\n 20 |' + '\n 21 | export async function usingWebAssemblyCompile(x) {' + '\n> 22 | const module = await WebAssembly.compile(SQUARE_WASM_BUFFER)' + - '\n | ^' - : '\n at usingWebAssemblyCompile (../../test/integration/edge-runtime-dynamic-code/lib/wasm.js:22:23)' + + '\n | ^' + : '\n at usingWebAssemblyCompile (../../test/integration/edge-runtime-dynamic-code/lib/wasm.js:22:24)' + '\n at middleware (../../test/integration/edge-runtime-dynamic-code/middleware.js:24:68)' + // Next.js internal frame. Feel free to adjust. // Not ignore-listed because we're not in an isolated app and Next.js is symlinked so it's not in node_modules '\n at' ) } else { + // Turbopack produces incorrect mappings in the sourcemap. expect(output).toContain( isTurbopack ? '' + // TODO(veil): Turbopack duplicates project path - '\n at usingWebAssemblyCompile (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/wasm.js:22:17)' + + '\n at usingWebAssemblyCompile (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/wasm.js:22:18)' + '\n at handler (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/pages/api/route.js:17:42)' + '\n 20 |' : '' + - '\n at usingWebAssemblyCompile (../../test/integration/edge-runtime-dynamic-code/lib/wasm.js:22:23)' + + '\n at usingWebAssemblyCompile (../../test/integration/edge-runtime-dynamic-code/lib/wasm.js:22:24)' + '\n at handler (../../test/integration/edge-runtime-dynamic-code/pages/api/route.js:17:42)' + // Next.js internal frame. Feel free to adjust. // Not ignore-listed because we're not in an isolated app and Next.js is symlinked so it's not in node_modules '\n at' ) - // TODO(veil): Inconsistent cursor position + // Turbopack produces incorrect mappings in the sourcemap. if (isTurbopack) { expect(output).toContain( '' + '\n> 22 | const module = await WebAssembly.compile(SQUARE_WASM_BUFFER)' + - '\n | ^' + '\n | ^' ) } else { + // TODO(veil): Inconsistent cursor position expect(output).toContain( '' + '\n> 22 | const module = await WebAssembly.compile(SQUARE_WASM_BUFFER)' + - '\n | ^' + '\n | ^' ) } } @@ -228,12 +231,12 @@ describe.each([ expect(output).toContain( isTurbopack ? '' + - '\n at async usingWebAssemblyInstantiateWithBuffer (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/wasm.js:28:23)' + - '\n at async middleware (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/middleware.js:37:29)' + + '\n at async usingWebAssemblyInstantiateWithBuffer (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/wasm.js:28:24)' + + '\n at async middleware (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/middleware.js:37:30)' + '\n 26 |\n' : '' + - '\n at async usingWebAssemblyInstantiateWithBuffer (../../test/integration/edge-runtime-dynamic-code/lib/wasm.js:28:23)' + - '\n at async middleware (../../test/integration/edge-runtime-dynamic-code/middleware.js:37:29)' + + '\n at async usingWebAssemblyInstantiateWithBuffer (../../test/integration/edge-runtime-dynamic-code/lib/wasm.js:28:24)' + + '\n at async middleware (../../test/integration/edge-runtime-dynamic-code/middleware.js:37:30)' + // Next.js internal frame. Feel free to adjust. // TODO(veil): https://linear.app/vercel/issue/NDX-464 '\n at ' @@ -241,27 +244,28 @@ describe.each([ expect(stripAnsi(output)).toContain( '' + '\n> 28 | const { instance } = await WebAssembly.instantiate(SQUARE_WASM_BUFFER, {})' + - '\n | ^' + '\n | ^' ) } else { expect(output).toContain( isTurbopack ? '' + // TODO(veil): Turbopack duplicates project path - '\n at async usingWebAssemblyInstantiateWithBuffer (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/wasm.js:28:23)' + - '\n at async handler (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/pages/api/route.js:21:16)' + + '\n at async usingWebAssemblyInstantiateWithBuffer (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/wasm.js:28:24)' + + '\n at async handler (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/pages/api/route.js:21:17)' + '\n 26 |' : '' + - '\n at async usingWebAssemblyInstantiateWithBuffer (../../test/integration/edge-runtime-dynamic-code/lib/wasm.js:28:23)' + - '\n at async handler (../../test/integration/edge-runtime-dynamic-code/pages/api/route.js:21:16)' + + '\n at async usingWebAssemblyInstantiateWithBuffer (../../test/integration/edge-runtime-dynamic-code/lib/wasm.js:28:24)' + + '\n at async handler (../../test/integration/edge-runtime-dynamic-code/pages/api/route.js:21:17)' + // Next.js internal frame. Feel free to adjust. // Not ignore-listed because we're not in an isolated app and Next.js is symlinked so it's not in node_modules '\n at' ) + // TODO(veil): Inconsistent cursor position expect(stripAnsi(output)).toContain( '' + '\n> 28 | const { instance } = await WebAssembly.instantiate(SQUARE_WASM_BUFFER, {})' + - '\n | ^' + '\n | ^' ) } }) diff --git a/test/integration/server-side-dev-errors/test/index.test.js b/test/integration/server-side-dev-errors/test/index.test.js index eef11f4622591..9bb2ee49c7607 100644 --- a/test/integration/server-side-dev-errors/test/index.test.js +++ b/test/integration/server-side-dev-errors/test/index.test.js @@ -79,11 +79,11 @@ describe('server-side dev errors', () => { expect(stderrOutput).toStartWith( '⨯ ReferenceError: missingVar is not defined' + - '\n at getStaticProps (../../test/integration/server-side-dev-errors/pages/gsp.js:6:2)' + + '\n at getStaticProps (../../test/integration/server-side-dev-errors/pages/gsp.js:6:3)' + '\n 4 |' + '\n 5 | export async function getStaticProps() {' + '\n> 6 | missingVar;return {' + - '\n | ^' + '\n | ^' ) await expect(browser).toDisplayRedbox(` @@ -129,11 +129,11 @@ describe('server-side dev errors', () => { ) expect(stderrOutput).toStartWith( '⨯ ReferenceError: missingVar is not defined' + - '\n at getServerSideProps (../../test/integration/server-side-dev-errors/pages/gssp.js:6:2)' + + '\n at getServerSideProps (../../test/integration/server-side-dev-errors/pages/gssp.js:6:3)' + '\n 4 |' + '\n 5 | export async function getServerSideProps() {' + '\n> 6 | missingVar;return {' + - '\n | ^' + '\n | ^' ) await expect(browser).toDisplayRedbox(` @@ -179,11 +179,11 @@ describe('server-side dev errors', () => { ) expect(stderrOutput).toStartWith( '⨯ ReferenceError: missingVar is not defined' + - '\n at getServerSideProps (../../test/integration/server-side-dev-errors/pages/blog/[slug].js:6:2)' + + '\n at getServerSideProps (../../test/integration/server-side-dev-errors/pages/blog/[slug].js:6:3)' + '\n 4 |' + '\n 5 | export async function getServerSideProps() {' + '\n> 6 | missingVar;return {' + - '\n | ^' + '\n | ^' ) await expect(browser).toDisplayRedbox(` @@ -227,22 +227,22 @@ describe('server-side dev errors', () => { if (isTurbopack) { expect(stderrOutput).toStartWith( '⨯ ReferenceError: missingVar is not defined' + - '\n at handler (../../test/integration/server-side-dev-errors/pages/api/hello.js:2:2)' + + '\n at handler (../../test/integration/server-side-dev-errors/pages/api/hello.js:2:3)' + '\n 1 | export default function handler(req, res) {' + "\n> 2 | missingVar;res.status(200).json({ hello: 'world' })" + - '\n | ^' + '\n | ^' ) } else { expect(stderrOutput).toStartWith( '⨯ ReferenceError: missingVar is not defined' + - '\n at handler (../../test/integration/server-side-dev-errors/pages/api/hello.js:2:2)' + + '\n at handler (../../test/integration/server-side-dev-errors/pages/api/hello.js:2:3)' + // TODO(veil): Why not ignore-listed? '\n at ' ) expect(stderrOutput).toContain( '\n 1 | export default function handler(req, res) {' + "\n> 2 | missingVar;res.status(200).json({ hello: 'world' })" + - '\n | ^' + '\n | ^' ) } @@ -293,22 +293,22 @@ describe('server-side dev errors', () => { if (isTurbopack) { expect(stderrOutput).toStartWith( '⨯ ReferenceError: missingVar is not defined' + - '\n at handler (../../test/integration/server-side-dev-errors/pages/api/blog/[slug].js:2:2)' + + '\n at handler (../../test/integration/server-side-dev-errors/pages/api/blog/[slug].js:2:3)' + '\n 1 | export default function handler(req, res) {' + '\n> 2 | missingVar;res.status(200).json({ slug: req.query.slug })' + - '\n | ^' + '\n | ^' ) } else { expect(stderrOutput).toStartWith( '⨯ ReferenceError: missingVar is not defined' + - '\n at handler (../../test/integration/server-side-dev-errors/pages/api/blog/[slug].js:2:2)' + + '\n at handler (../../test/integration/server-side-dev-errors/pages/api/blog/[slug].js:2:3)' + // TODO(veil): Why not ignore-listed? '\n at' ) expect(stderrOutput).toContain( '\n 1 | export default function handler(req, res) {' + '\n> 2 | missingVar;res.status(200).json({ slug: req.query.slug })' + - '\n | ^' + '\n | ^' ) } @@ -354,62 +354,63 @@ describe('server-side dev errors', () => { .trim() // FIXME(veil): error repeated if (isTurbopack) { + // Turbopack produces incorrect mappings in the sourcemap. expect(stderrOutput).toMatchInlineSnapshot(` - "Error: catch this rejection - at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:19) - 5 | export async function getServerSideProps() { - 6 | setTimeout(() => { - > 7 | Promise.reject(new Error('catch this rejection')) - | ^ - 8 | }, 10) - 9 | return { - 10 | props: {}, - ⨯ unhandledRejection: Error: catch this rejection - at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:19) - 5 | export async function getServerSideProps() { - 6 | setTimeout(() => { - > 7 | Promise.reject(new Error('catch this rejection')) - | ^ - 8 | }, 10) - 9 | return { - 10 | props: {}, - ⨯ unhandledRejection: Error: catch this rejection - at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:19) - 5 | export async function getServerSideProps() { - 6 | setTimeout(() => { - > 7 | Promise.reject(new Error('catch this rejection')) - | ^ - 8 | }, 10) - 9 | return { - 10 | props: {}," + "Error: catch this rejection + at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:20) + 5 | export async function getServerSideProps() { + 6 | setTimeout(() => { + > 7 | Promise.reject(new Error('catch this rejection')) + | ^ + 8 | }, 10) + 9 | return { + 10 | props: {}, + ⨯ unhandledRejection: Error: catch this rejection + at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:20) + 5 | export async function getServerSideProps() { + 6 | setTimeout(() => { + > 7 | Promise.reject(new Error('catch this rejection')) + | ^ + 8 | }, 10) + 9 | return { + 10 | props: {}, + ⨯ unhandledRejection: Error: catch this rejection + at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:20) + 5 | export async function getServerSideProps() { + 6 | setTimeout(() => { + > 7 | Promise.reject(new Error('catch this rejection')) + | ^ + 8 | }, 10) + 9 | return { + 10 | props: {}," `) } else { // sometimes there is a leading newline, so trim it expect(stderrOutput.trimStart()).toMatchInlineSnapshot(` "Error: catch this rejection - at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:19) + at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:20) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | Promise.reject(new Error('catch this rejection')) - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}, ⨯ unhandledRejection: Error: catch this rejection - at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:19) + at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:20) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | Promise.reject(new Error('catch this rejection')) - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}, ⨯ unhandledRejection: Error: catch this rejection - at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:19) + at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-rejection.js:7:20) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | Promise.reject(new Error('catch this rejection')) - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}," @@ -435,29 +436,29 @@ describe('server-side dev errors', () => { if (isTurbopack) { expect(stderrOutput).toMatchInlineSnapshot(` "Error: - at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19) + at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:20) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | Promise.reject(new Error()) - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}, ⨯ unhandledRejection: Error: - at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19) + at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:20) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | Promise.reject(new Error()) - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}, ⨯ unhandledRejection: Error: - at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19) + at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:20) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | Promise.reject(new Error()) - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}," @@ -465,29 +466,29 @@ describe('server-side dev errors', () => { } else { expect(stderrOutput).toMatchInlineSnapshot(` "Error: - at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19) + at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:20) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | Promise.reject(new Error()) - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}, ⨯ unhandledRejection: Error: - at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19) + at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:20) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | Promise.reject(new Error()) - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}, ⨯ unhandledRejection: Error: - at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:19) + at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-rejection.js:7:20) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | Promise.reject(new Error()) - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}," @@ -512,63 +513,63 @@ describe('server-side dev errors', () => { // FIXME(veil): error repeated if (isTurbopack) { expect(stderrOutput).toMatchInlineSnapshot(` - "Error: catch this exception - at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:10) - 5 | export async function getServerSideProps() { - 6 | setTimeout(() => { - > 7 | throw new Error('catch this exception') - | ^ - 8 | }, 10) - 9 | return { - 10 | props: {}, - ⨯ uncaughtException: Error: catch this exception - at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:10) - 5 | export async function getServerSideProps() { - 6 | setTimeout(() => { - > 7 | throw new Error('catch this exception') - | ^ - 8 | }, 10) - 9 | return { - 10 | props: {}, - ⨯ uncaughtException: Error: catch this exception - at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:10) - 5 | export async function getServerSideProps() { - 6 | setTimeout(() => { - > 7 | throw new Error('catch this exception') - | ^ - 8 | }, 10) - 9 | return { - 10 | props: {}," + "Error: catch this exception + at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:11) + 5 | export async function getServerSideProps() { + 6 | setTimeout(() => { + > 7 | throw new Error('catch this exception') + | ^ + 8 | }, 10) + 9 | return { + 10 | props: {}, + ⨯ uncaughtException: Error: catch this exception + at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:11) + 5 | export async function getServerSideProps() { + 6 | setTimeout(() => { + > 7 | throw new Error('catch this exception') + | ^ + 8 | }, 10) + 9 | return { + 10 | props: {}, + ⨯ uncaughtException: Error: catch this exception + at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:11) + 5 | export async function getServerSideProps() { + 6 | setTimeout(() => { + > 7 | throw new Error('catch this exception') + | ^ + 8 | }, 10) + 9 | return { + 10 | props: {}," `) } else { expect(stderrOutput).toMatchInlineSnapshot(` - "Error: catch this exception - at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:10) - 5 | export async function getServerSideProps() { - 6 | setTimeout(() => { - > 7 | throw new Error('catch this exception') - | ^ - 8 | }, 10) - 9 | return { - 10 | props: {}, - ⨯ uncaughtException: Error: catch this exception - at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:10) - 5 | export async function getServerSideProps() { - 6 | setTimeout(() => { - > 7 | throw new Error('catch this exception') - | ^ - 8 | }, 10) - 9 | return { - 10 | props: {}, - ⨯ uncaughtException: Error: catch this exception - at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:10) - 5 | export async function getServerSideProps() { - 6 | setTimeout(() => { - > 7 | throw new Error('catch this exception') - | ^ - 8 | }, 10) - 9 | return { - 10 | props: {}," + "Error: catch this exception + at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:11) + 5 | export async function getServerSideProps() { + 6 | setTimeout(() => { + > 7 | throw new Error('catch this exception') + | ^ + 8 | }, 10) + 9 | return { + 10 | props: {}, + ⨯ uncaughtException: Error: catch this exception + at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:11) + 5 | export async function getServerSideProps() { + 6 | setTimeout(() => { + > 7 | throw new Error('catch this exception') + | ^ + 8 | }, 10) + 9 | return { + 10 | props: {}, + ⨯ uncaughtException: Error: catch this exception + at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-exception.js:7:11) + 5 | export async function getServerSideProps() { + 6 | setTimeout(() => { + > 7 | throw new Error('catch this exception') + | ^ + 8 | }, 10) + 9 | return { + 10 | props: {}," `) } }) @@ -591,29 +592,29 @@ describe('server-side dev errors', () => { if (isTurbopack) { expect(stderrOutput).toMatchInlineSnapshot(` "Error: - at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10) + at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:11) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | throw new Error() - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}, ⨯ uncaughtException: Error: - at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10) + at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:11) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | throw new Error() - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}, ⨯ uncaughtException: Error: - at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10) + at Timeout._onTimeout (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:11) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | throw new Error() - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}," @@ -621,29 +622,29 @@ describe('server-side dev errors', () => { } else { expect(stderrOutput).toMatchInlineSnapshot(` "Error: - at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10) + at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:11) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | throw new Error() - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}, ⨯ uncaughtException: Error: - at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10) + at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:11) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | throw new Error() - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}, ⨯ uncaughtException: Error: - at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:10) + at Timeout.eval [as _onTimeout] (../../test/integration/server-side-dev-errors/pages/uncaught-empty-exception.js:7:11) 5 | export async function getServerSideProps() { 6 | setTimeout(() => { > 7 | throw new Error() - | ^ + | ^ 8 | }, 10) 9 | return { 10 | props: {}," diff --git a/test/production/app-dir/build-output-prerender/build-output-prerender.test.ts b/test/production/app-dir/build-output-prerender/build-output-prerender.test.ts index 22a9a8a4c05e2..b81956e38b22a 100644 --- a/test/production/app-dir/build-output-prerender/build-output-prerender.test.ts +++ b/test/production/app-dir/build-output-prerender/build-output-prerender.test.ts @@ -82,10 +82,11 @@ describe('build-output-prerender', () => { // TODO(veil): Why is the location incomplete unless we enable --no-mangling? expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(` "Error: Route "/client" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client - at c (turbopack:///[project]/app/client/page.tsx:5:0) + at c (bundler:///app/client/page.tsx:5:1) 3 | export default function Page() { 4 | return

    Current time: {new Date().toISOString()}

    > 5 | } + | ^ 6 | To get a more detailed stack trace and pinpoint the issue, try one of the following: - Start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error. @@ -201,61 +202,32 @@ describe('build-output-prerender', () => { }) it('shows all prerender errors with readable stacks and code frames', async () => { - if (isTurbopack) { - expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(` - "Error: Route "/client" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client - at Page (turbopack:///[project]/app/client/page.tsx:4:27) - 2 | - 3 | export default function Page() { - > 4 | return

    Current time: {new Date().toISOString()}

    - | ^ - 5 | } - 6 | - To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error. - Error occurred prerendering page "/client". Read more: https://nextjs.org/docs/messages/prerender-error - Error: Route "/server" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random - at Page (turbopack:///[project]/app/server/page.tsx:13:26) - 11 | await cachedDelay() - 12 | - > 13 | return

    Random: {Math.random()}

    - | ^ - 14 | } - 15 | - To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "/server" in your browser to investigate the error. - Error occurred prerendering page "/server". Read more: https://nextjs.org/docs/messages/prerender-error - - > Export encountered errors on following paths: - /client/page: /client - /server/page: /server" - `) - } else { - expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(` - "Error: Route "/client" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client - at Page (webpack:///app/client/page.tsx:4:27) - 2 | - 3 | export default function Page() { - > 4 | return

    Current time: {new Date().toISOString()}

    - | ^ - 5 | } - 6 | - To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error. - Error occurred prerendering page "/client". Read more: https://nextjs.org/docs/messages/prerender-error - Error: Route "/server" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random - at Page (webpack:///app/server/page.tsx:13:26) - 11 | await cachedDelay() - 12 | - > 13 | return

    Random: {Math.random()}

    - | ^ - 14 | } - 15 | - To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "/server" in your browser to investigate the error. - Error occurred prerendering page "/server". Read more: https://nextjs.org/docs/messages/prerender-error + expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(` + "Error: Route "/client" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client + at Page (bundler:///app/client/page.tsx:4:28) + 2 | + 3 | export default function Page() { + > 4 | return

    Current time: {new Date().toISOString()}

    + | ^ + 5 | } + 6 | + To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error. + Error occurred prerendering page "/client". Read more: https://nextjs.org/docs/messages/prerender-error + Error: Route "/server" used \`Math.random()\` outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random + at Page (bundler:///app/server/page.tsx:13:27) + 11 | await cachedDelay() + 12 | + > 13 | return

    Random: {Math.random()}

    + | ^ + 14 | } + 15 | + To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "/server" in your browser to investigate the error. + Error occurred prerendering page "/server". Read more: https://nextjs.org/docs/messages/prerender-error - > Export encountered errors on following paths: - /client/page: /client - /server/page: /server" - `) - } + > Export encountered errors on following paths: + /client/page: /client + /server/page: /server" + `) }) }) }) @@ -442,7 +414,11 @@ function getPrerenderOutput(cliOutput: string): string { if (foundPrerenderingLine && !line.includes('Generating static pages')) { lines.push( - line.replace(/at \w+ \(.next[^)]+\)/, 'at x ()') + line + .replace(/at \w+ \(.next[^)]+\)/, 'at x ()') + // TODO(veil): Bundler protocols should not appear in stackframes. + .replace('webpack:///', 'bundler:///') + .replace('turbopack:///[project]/', 'bundler:///') ) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs b/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs index 77051980b028a..153204b4522e8 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs @@ -93,26 +93,29 @@ impl ReferencedAssetIdent { ctxt, export, } => { - let ns = Ident::new( - namespace_ident.as_str().into(), - span, - ctxt.unwrap_or_default(), - ); if let Some(export) = export { Either::Right(MemberExpr { span, - obj: Box::new(Expr::Ident(ns)), + obj: Box::new(Expr::Ident(Ident::new( + namespace_ident.as_str().into(), + DUMMY_SP, + ctxt.unwrap_or_default(), + ))), prop: MemberProp::Computed(ComputedPropName { - span, + span: DUMMY_SP, expr: Box::new(Expr::Lit(Lit::Str(Str { - span, + span: DUMMY_SP, value: export.as_str().into(), raw: None, }))), }), }) } else { - Either::Left(ns) + Either::Left(Ident::new( + namespace_ident.as_str().into(), + span, + ctxt.unwrap_or_default(), + )) } } } @@ -125,13 +128,13 @@ impl ReferencedAssetIdent { Expr::Seq(SeqExpr { exprs: vec![ Box::new(Expr::Lit(Lit::Num(Number { - span, + span: DUMMY_SP, value: 0.0, raw: None, }))), Box::new(member.into()), ], - span, + span: DUMMY_SP, }) } else { member.into() diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/output/4c35f_tests_snapshot_basic-tree-shake_dynamic-import_input_lib_b2d8c81e.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/output/4c35f_tests_snapshot_basic-tree-shake_dynamic-import_input_lib_b2d8c81e.js.map index 6a221a3403076..3b08e2f445d3b 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/output/4c35f_tests_snapshot_basic-tree-shake_dynamic-import_input_lib_b2d8c81e.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/output/4c35f_tests_snapshot_basic-tree-shake_dynamic-import_input_lib_b2d8c81e.js.map @@ -3,13 +3,13 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}}, - {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,kPAAA,CAAA,IAAG,IAAI;AAQP,kPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,kPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,kPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,kPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,kPAAA,CAAA,IAAG"}}, - {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,SAAS;IACP,OAAO,kPAAA,CAAA,IAAG;AACZ;AAMA,SAAS,OAAO,MAAM;IACpB,kPAAA,CAAA,IAAG,GAAG;AACR;AAMO,MAAM,SAAS;IACpB,SAAS,kPAAA,CAAA,IAAG;IACZ,KAAK;IACL,KAAK;AACP"}}, + {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,uPAAG,IAAI;AAQP,uPAAG,IAAI"}}, + {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,uPAAG,IAAI"}}, + {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,uPAAG;AAQf,QAAQ,GAAG,CAAC,uPAAG;AAQf,QAAQ,GAAG,CAAC,uPAAG"}}, + {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,SAAS;IACP,OAAO,uPAAG;AACZ;AAMA,SAAS,OAAO,MAAM;IACpB,uPAAG,GAAG;AACR;AAMO,MAAM,SAAS;IACpB,SAAS,uPAAG;IACZ,KAAK;IACL,KAAK;AACP"}}, {"offset": {"line": 89, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AA4BO,IAAI,MAAM"}}, - {"offset": {"line": 101, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,aAAa,kPAAA,CAAA,IAAG"}}, - {"offset": {"line": 117, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCO,SAAS;IACd,OAAO,kPAAA,CAAA,IAAG,GAAG,kPAAA,CAAA,IAAG;AAClB"}}, + {"offset": {"line": 101, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,aAAa,uPAAG"}}, + {"offset": {"line": 117, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/dynamic-import/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCO,SAAS;IACd,OAAO,uPAAG,GAAG,uPAAG;AAClB"}}, {"offset": {"line": 139, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, {"offset": {"line": 149, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, {"offset": {"line": 167, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}] diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-named_input_058a40bc._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-named_input_058a40bc._.js.map index af7beaad3d7a3..4cc848e510e82 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-named_input_058a40bc._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-named_input_058a40bc._.js.map @@ -3,11 +3,11 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}}, - {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,gPAAA,CAAA,IAAG,IAAI;AAQP,gPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,gPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG"}}, + {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,qPAAG,IAAI;AAQP,qPAAG,IAAI"}}, + {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,qPAAG,IAAI"}}, + {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,qPAAG;AAQf,QAAQ,GAAG,CAAC,qPAAG;AAQf,QAAQ,GAAG,CAAC,qPAAG"}}, {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AA4BO,IAAI,MAAM"}}, {"offset": {"line": 63, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, {"offset": {"line": 73, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, - {"offset": {"line": 91, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/index.js"],"sourcesContent":["import { fakeCat } from './module'\n\nconsole.log(fakeCat)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,mPAAA,CAAA,UAAO"}}] + {"offset": {"line": 91, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-named/input/index.js"],"sourcesContent":["import { fakeCat } from './module'\n\nconsole.log(fakeCat)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,8PAAO"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-namespace_input_f7fde6f3._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-namespace_input_f7fde6f3._.js.map index 1b56fc914da38..9d5a4180e15b0 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-namespace_input_f7fde6f3._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_export-namespace_input_f7fde6f3._.js.map @@ -3,15 +3,15 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}}, - {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,oPAAA,CAAA,IAAG,IAAI;AAQP,oPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,oPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,oPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,oPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,oPAAA,CAAA,IAAG"}}, - {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,SAAS;IACP,OAAO,oPAAA,CAAA,IAAG;AACZ;AAMA,SAAS,OAAO,MAAM;IACpB,oPAAA,CAAA,IAAG,GAAG;AACR;AAMO,MAAM,SAAS;IACpB,SAAS,oPAAA,CAAA,IAAG;IACZ,KAAK;IACL,KAAK;AACP"}}, + {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,yPAAG,IAAI;AAQP,yPAAG,IAAI"}}, + {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,yPAAG,IAAI"}}, + {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,yPAAG;AAQf,QAAQ,GAAG,CAAC,yPAAG;AAQf,QAAQ,GAAG,CAAC,yPAAG"}}, + {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,SAAS;IACP,OAAO,yPAAG;AACZ;AAMA,SAAS,OAAO,MAAM;IACpB,yPAAG,GAAG;AACR;AAMO,MAAM,SAAS;IACpB,SAAS,yPAAG;IACZ,KAAK;IACL,KAAK;AACP"}}, {"offset": {"line": 89, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AA4BO,IAAI,MAAM"}}, - {"offset": {"line": 101, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,aAAa,oPAAA,CAAA,IAAG"}}, - {"offset": {"line": 117, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCO,SAAS;IACd,OAAO,oPAAA,CAAA,IAAG,GAAG,oPAAA,CAAA,IAAG;AAClB"}}, + {"offset": {"line": 101, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,aAAa,yPAAG"}}, + {"offset": {"line": 117, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCO,SAAS;IACd,OAAO,yPAAG,GAAG,yPAAG;AAClB"}}, {"offset": {"line": 139, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, {"offset": {"line": 149, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, {"offset": {"line": 167, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, - {"offset": {"line": 182, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/index.js"],"sourcesContent":["import { lib } from './module'\n\nconsole.log(lib.cat)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,uPAAA,CAAA,MAAG,CAAC,GAAG"}}] + {"offset": {"line": 182, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/export-namespace/input/index.js"],"sourcesContent":["import { lib } from './module'\n\nconsole.log(lib.cat)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,8PAAG,CAAC,GAAG"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named-all_input_00b867a0._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named-all_input_00b867a0._.js.map index 7e62e70a7f0d9..8841148991797 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named-all_input_00b867a0._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named-all_input_00b867a0._.js.map @@ -3,10 +3,10 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}}, - {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,uPAAA,CAAA,IAAG,IAAI;AAQP,uPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,uPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,uPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,uPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,uPAAA,CAAA,IAAG"}}, + {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,4PAAG,IAAI;AAQP,4PAAG,IAAI"}}, + {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,4PAAG,IAAI"}}, + {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,4PAAG;AAQf,QAAQ,GAAG,CAAC,4PAAG;AAQf,QAAQ,GAAG,CAAC,4PAAG"}}, {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AA4BO,IAAI,MAAM"}}, {"offset": {"line": 63, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, - {"offset": {"line": 73, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/index.js"],"sourcesContent":["import { cat as c, dogRef, initialCat, getChimera } from './lib'\n\nconsole.log(c)\n\n// TODO: Execution\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,QAAQ,GAAG,CAAC,uPAAA,CAAA,MAAC,GAEb,kBAAkB"}}] + {"offset": {"line": 73, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named-all/input/index.js"],"sourcesContent":["import { cat as c, dogRef, initialCat, getChimera } from './lib'\n\nconsole.log(c)\n\n// TODO: Execution\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,QAAQ,GAAG,CAAC,8PAAC,GAEb,kBAAkB"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named_input_f64e7412._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named_input_f64e7412._.js.map index 4978d04560eaf..d8545108293c2 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named_input_f64e7412._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-named_input_f64e7412._.js.map @@ -3,10 +3,10 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}}, - {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,gPAAA,CAAA,IAAG,IAAI;AAQP,gPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,gPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG"}}, + {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,qPAAG,IAAI;AAQP,qPAAG,IAAI"}}, + {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,qPAAG,IAAI"}}, + {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,qPAAG;AAQf,QAAQ,GAAG,CAAC,qPAAG;AAQf,QAAQ,GAAG,CAAC,qPAAG"}}, {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AA4BO,IAAI,MAAM"}}, {"offset": {"line": 63, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, - {"offset": {"line": 73, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/index.js"],"sourcesContent":["import { cat as c } from './lib'\n\nconsole.log(c)\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,QAAQ,GAAG,CAAC,gPAAA,CAAA,MAAC"}}] + {"offset": {"line": 73, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-named/input/index.js"],"sourcesContent":["import { cat as c } from './lib'\n\nconsole.log(c)\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,QAAQ,GAAG,CAAC,uPAAC"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-namespace_input_25e69485._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-namespace_input_25e69485._.js.map index 5e60e77a82f07..e842ae1179697 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-namespace_input_25e69485._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/output/b1abf_turbopack-tests_tests_snapshot_basic-tree-shake_import-namespace_input_25e69485._.js.map @@ -3,14 +3,14 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}}, - {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,oPAAA,CAAA,IAAG,IAAI;AAQP,oPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,oPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,oPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,oPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,oPAAA,CAAA,IAAG"}}, - {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,SAAS;IACP,OAAO,oPAAA,CAAA,IAAG;AACZ;AAMA,SAAS,OAAO,MAAM;IACpB,oPAAA,CAAA,IAAG,GAAG;AACR;AAMO,MAAM,SAAS;IACpB,SAAS,oPAAA,CAAA,IAAG;IACZ,KAAK;IACL,KAAK;AACP"}}, + {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,yPAAG,IAAI;AAQP,yPAAG,IAAI"}}, + {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,yPAAG,IAAI"}}, + {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,yPAAG;AAQf,QAAQ,GAAG,CAAC,yPAAG;AAQf,QAAQ,GAAG,CAAC,yPAAG"}}, + {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,SAAS;IACP,OAAO,yPAAG;AACZ;AAMA,SAAS,OAAO,MAAM;IACpB,yPAAG,GAAG;AACR;AAMO,MAAM,SAAS;IACpB,SAAS,yPAAG;IACZ,KAAK;IACL,KAAK;AACP"}}, {"offset": {"line": 89, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AA4BO,IAAI,MAAM"}}, - {"offset": {"line": 101, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,aAAa,oPAAA,CAAA,IAAG"}}, - {"offset": {"line": 117, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCO,SAAS;IACd,OAAO,oPAAA,CAAA,IAAG,GAAG,oPAAA,CAAA,IAAG;AAClB"}}, + {"offset": {"line": 101, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,aAAa,yPAAG"}}, + {"offset": {"line": 117, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCO,SAAS;IACd,OAAO,yPAAG,GAAG,yPAAG;AAClB"}}, {"offset": {"line": 139, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, {"offset": {"line": 149, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, - {"offset": {"line": 167, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/index.js"],"sourcesContent":["import * as lib from './lib'\n\nconsole.log(lib.cat)\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,QAAQ,GAAG,CAAC,0OAAA,CAAA,MAAO"}}] + {"offset": {"line": 167, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-namespace/input/index.js"],"sourcesContent":["import * as lib from './lib'\n\nconsole.log(lib.cat)\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,QAAQ,GAAG,CAAC,iPAAO"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/output/4c35f_tests_snapshot_basic-tree-shake_import-side-effect_input_e082b9f6._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/output/4c35f_tests_snapshot_basic-tree-shake_import-side-effect_input_e082b9f6._.js.map index 94a607e0f6fea..1394536ffe88d 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/output/4c35f_tests_snapshot_basic-tree-shake_import-side-effect_input_e082b9f6._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/output/4c35f_tests_snapshot_basic-tree-shake_import-side-effect_input_e082b9f6._.js.map @@ -3,8 +3,8 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}}, - {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,yPAAA,CAAA,IAAG,IAAI;AAQP,yPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,yPAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,yPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,yPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,yPAAA,CAAA,IAAG"}}, + {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,8PAAG,IAAI;AAQP,8PAAG,IAAI"}}, + {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,8PAAG,IAAI"}}, + {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,8PAAG;AAQf,QAAQ,GAAG,CAAC,8PAAG;AAQf,QAAQ,GAAG,CAAC,8PAAG"}}, {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/import-side-effect/input/index.js"],"sourcesContent":["import './lib'\n"],"names":[],"mappings":";AAAA"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/output/4c35f_tests_snapshot_basic-tree-shake_require-side-effect_input_f83a22d6._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/output/4c35f_tests_snapshot_basic-tree-shake_require-side-effect_input_f83a22d6._.js.map index 767b41b529ae5..614961bd06624 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/output/4c35f_tests_snapshot_basic-tree-shake_require-side-effect_input_f83a22d6._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/output/4c35f_tests_snapshot_basic-tree-shake_require-side-effect_input_f83a22d6._.js.map @@ -3,13 +3,13 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}}, - {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,0PAAA,CAAA,IAAG,IAAI;AAQP,0PAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,0PAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,0PAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,0PAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,0PAAA,CAAA,IAAG"}}, - {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,SAAS;IACP,OAAO,0PAAA,CAAA,IAAG;AACZ;AAMA,SAAS,OAAO,MAAM;IACpB,0PAAA,CAAA,IAAG,GAAG;AACR;AAMO,MAAM,SAAS;IACpB,SAAS,0PAAA,CAAA,IAAG;IACZ,KAAK;IACL,KAAK;AACP"}}, + {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,+PAAG,IAAI;AAQP,+PAAG,IAAI"}}, + {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,+PAAG,IAAI"}}, + {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,+PAAG;AAQf,QAAQ,GAAG,CAAC,+PAAG;AAQf,QAAQ,GAAG,CAAC,+PAAG"}}, + {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,SAAS;IACP,OAAO,+PAAG;AACZ;AAMA,SAAS,OAAO,MAAM;IACpB,+PAAG,GAAG;AACR;AAMO,MAAM,SAAS;IACpB,SAAS,+PAAG;IACZ,KAAK;IACL,KAAK;AACP"}}, {"offset": {"line": 89, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AA4BO,IAAI,MAAM"}}, - {"offset": {"line": 101, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,aAAa,0PAAA,CAAA,IAAG"}}, - {"offset": {"line": 117, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCO,SAAS;IACd,OAAO,0PAAA,CAAA,IAAG,GAAG,0PAAA,CAAA,IAAG;AAClB"}}, + {"offset": {"line": 101, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,aAAa,+PAAG"}}, + {"offset": {"line": 117, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/require-side-effect/input/lib.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCO,SAAS;IACd,OAAO,+PAAG,GAAG,+PAAG;AAClB"}}, {"offset": {"line": 139, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, {"offset": {"line": 149, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, {"offset": {"line": 167, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/output/4c35f_tests_snapshot_basic-tree-shake_tree-shake-test-1_input_index_09a16221.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/output/4c35f_tests_snapshot_basic-tree-shake_tree-shake-test-1_input_index_09a16221.js.map index 23c8747479888..9a08967305ec5 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/output/4c35f_tests_snapshot_basic-tree-shake_tree-shake-test-1_input_index_09a16221.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/output/4c35f_tests_snapshot_basic-tree-shake_tree-shake-test-1_input_index_09a16221.js.map @@ -3,13 +3,13 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM"}}, - {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,6PAAA,CAAA,IAAG,IAAI;AAQP,6PAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,6PAAA,CAAA,IAAG,IAAI"}}, - {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,6PAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,6PAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,6PAAA,CAAA,IAAG"}}, - {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,SAAS;IACP,OAAO,6PAAA,CAAA,IAAG;AACZ;AAMA,SAAS,OAAO,MAAM;IACpB,6PAAA,CAAA,IAAG,GAAG;AACR;AAMO,MAAM,SAAS;IACpB,SAAS,6PAAA,CAAA,IAAG;IACZ,KAAK;IACL,KAAK;AACP"}}, + {"offset": {"line": 17, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;AAEA,kQAAG,IAAI;AAQP,kQAAG,IAAI"}}, + {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;AAkBA,kQAAG,IAAI"}}, + {"offset": {"line": 36, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;AAIA,QAAQ,GAAG,CAAC,kQAAG;AAQf,QAAQ,GAAG,CAAC,kQAAG;AAQf,QAAQ,GAAG,CAAC,kQAAG"}}, + {"offset": {"line": 51, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,SAAS;IACP,OAAO,kQAAG;AACZ;AAMA,SAAS,OAAO,MAAM;IACpB,kQAAG,GAAG;AACR;AAMO,MAAM,SAAS;IACpB,SAAS,kQAAG;IACZ,KAAK;IACL,KAAK;AACP"}}, {"offset": {"line": 89, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;AA4BO,IAAI,MAAM"}}, - {"offset": {"line": 101, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,aAAa,6PAAA,CAAA,IAAG"}}, - {"offset": {"line": 117, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCO,SAAS;IACd,OAAO,6PAAA,CAAA,IAAG,GAAG,6PAAA,CAAA,IAAG;AAClB"}}, + {"offset": {"line": 101, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,aAAa,kQAAG"}}, + {"offset": {"line": 117, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["let dog = 'dog'\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction getDog() {\n return dog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nfunction setDog(newDog) {\n dog = newDog\n}\n\ndog += '!'\n\nconsole.log(dog)\n\nexport const dogRef = {\n initial: dog,\n get: getDog,\n set: setDog,\n}\n\nexport let cat = 'cat'\n\nexport const initialCat = cat\n\nexport function getChimera() {\n return cat + dog\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCO,SAAS;IACd,OAAO,kQAAG,GAAG,kQAAG;AAClB"}}, {"offset": {"line": 139, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, {"offset": {"line": 149, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}, {"offset": {"line": 167, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}}] diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_46366300._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_46366300._.js.map index 53c5be59b2f3e..3f94bb43a2548 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_46366300._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_46366300._.js.map @@ -3,6 +3,6 @@ "sources": [], "sections": [ {"offset": {"line": 6, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/shared.js"],"sourcesContent":["// shared package\n"],"names":[],"mappings":"AAAA,iBAAiB"}}, - {"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/index.js"],"sourcesContent":["import { bar } from 'bar'\nimport './shared'\n\nbar(true)\n\nimport('./import').then(({ foo }) => {\n foo(true)\n})\n"],"names":[],"mappings":";AAAA;AACA;;;AAEA,CAAA,GAAA,yNAAA,CAAA,MAAG,AAAD,EAAE;AAEJ,kLAAmB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE;IAC9B,IAAI;AACN"}}, + {"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/index.js"],"sourcesContent":["import { bar } from 'bar'\nimport './shared'\n\nbar(true)\n\nimport('./import').then(({ foo }) => {\n foo(true)\n})\n"],"names":[],"mappings":";AAAA;AACA;;;AAEA,IAAA,gOAAG,EAAC;AAEJ,kLAAmB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE;IAC9B,IAAI;AACN"}}, {"offset": {"line": 24, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/node_modules/bar/index.js"],"sourcesContent":["export function bar(value) {\n console.assert(value);\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,IAAI,KAAK;IACvB,QAAQ,MAAM,CAAC;AACjB","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_b274c771._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_b274c771._.js.map index 3df24edbcc4a3..f95b98216a6d2 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_b274c771._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_b274c771._.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/import.js"],"sourcesContent":["import { foo } from 'foo'\nimport { bar } from 'bar'\nimport './shared'\n\nfoo(true)\nbar(true)\n"],"names":[],"mappings":";AAAA;AACA;AACA;;;;AAEA,CAAA,GAAA,yNAAA,CAAA,MAAG,AAAD,EAAE;AACJ,CAAA,GAAA,yNAAA,CAAA,MAAG,AAAD,EAAE"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/import.js"],"sourcesContent":["import { foo } from 'foo'\nimport { bar } from 'bar'\nimport './shared'\n\nfoo(true)\nbar(true)\n"],"names":[],"mappings":";AAAA;AACA;AACA;;;;AAEA,IAAA,gOAAG,EAAC;AACJ,IAAA,gOAAG,EAAC"}}, {"offset": {"line": 18, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk/input/node_modules/foo/index.js"],"sourcesContent":["export function foo(value) {\n console.assert(value);\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,IAAI,KAAK;IACvB,QAAQ,MAAM,CAAC;AACjB","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/output/4e721_crates_turbopack-tests_tests_snapshot_basic_async_chunk_build_input_1e41378a._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/output/4e721_crates_turbopack-tests_tests_snapshot_basic_async_chunk_build_input_1e41378a._.js.map index 4093d8c09a36e..011cbee7a9223 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/output/4e721_crates_turbopack-tests_tests_snapshot_basic_async_chunk_build_input_1e41378a._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/output/4e721_crates_turbopack-tests_tests_snapshot_basic_async_chunk_build_input_1e41378a._.js.map @@ -3,6 +3,6 @@ "sources": [], "sections": [ {"offset": {"line": 6, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/shared.js"],"sourcesContent":["// shared package\n"],"names":[],"mappings":"AAAA,iBAAiB"}}, - {"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/index.js"],"sourcesContent":["import { bar } from 'bar'\nimport './shared'\n\nbar(true)\n\nimport('./import').then(({ foo }) => {\n foo(true)\n})\n"],"names":[],"mappings":";AAAA;AACA;;;AAEA,CAAA,GAAA,+NAAA,CAAA,MAAG,AAAD,EAAE;AAEJ,wLAAmB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE;IAC9B,IAAI;AACN"}}, + {"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/index.js"],"sourcesContent":["import { bar } from 'bar'\nimport './shared'\n\nbar(true)\n\nimport('./import').then(({ foo }) => {\n foo(true)\n})\n"],"names":[],"mappings":";AAAA;AACA;;;AAEA,IAAA,sOAAG,EAAC;AAEJ,wLAAmB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE;IAC9B,IAAI;AACN"}}, {"offset": {"line": 24, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/node_modules/bar/index.js"],"sourcesContent":["export function bar(value) {\n console.assert(value);\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,IAAI,KAAK;IACvB,QAAQ,MAAM,CAAC;AACjB","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/output/4e721_crates_turbopack-tests_tests_snapshot_basic_async_chunk_build_input_23e8ba79._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/output/4e721_crates_turbopack-tests_tests_snapshot_basic_async_chunk_build_input_23e8ba79._.js.map index 43ecc00a891f1..3eb7a7fc0dd24 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/output/4e721_crates_turbopack-tests_tests_snapshot_basic_async_chunk_build_input_23e8ba79._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/output/4e721_crates_turbopack-tests_tests_snapshot_basic_async_chunk_build_input_23e8ba79._.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/import.js"],"sourcesContent":["import { foo } from 'foo'\nimport { bar } from 'bar'\nimport './shared'\n\nfoo(true)\nbar(true)\n"],"names":[],"mappings":";AAAA;AACA;AACA;;;;AAEA,CAAA,GAAA,+NAAA,CAAA,MAAG,AAAD,EAAE;AACJ,CAAA,GAAA,+NAAA,CAAA,MAAG,AAAD,EAAE"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/import.js"],"sourcesContent":["import { foo } from 'foo'\nimport { bar } from 'bar'\nimport './shared'\n\nfoo(true)\nbar(true)\n"],"names":[],"mappings":";AAAA;AACA;AACA;;;;AAEA,IAAA,sOAAG,EAAC;AACJ,IAAA,sOAAG,EAAC"}}, {"offset": {"line": 18, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/async_chunk_build/input/node_modules/foo/index.js"],"sourcesContent":["export function foo(value) {\n console.assert(value);\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,IAAI,KAAK;IACvB,QAAQ,MAAM,CAAC;AACjB","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic/chunked/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_chunked_input_1efdaca0._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic/chunked/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_chunked_input_1efdaca0._.js.map index a5db8ceffb3f4..6f76b432708ad 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic/chunked/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_chunked_input_1efdaca0._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic/chunked/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_chunked_input_1efdaca0._.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/chunked/input/index.js"],"sourcesContent":["import { foo } from 'foo'\n\nfoo(true)\n"],"names":[],"mappings":";AAAA;;AAEA,CAAA,GAAA,qNAAA,CAAA,MAAG,AAAD,EAAE"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/chunked/input/index.js"],"sourcesContent":["import { foo } from 'foo'\n\nfoo(true)\n"],"names":[],"mappings":";AAAA;;AAEA,IAAA,4NAAG,EAAC"}}, {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/chunked/input/node_modules/foo/index.js"],"sourcesContent":["export function foo(value) {\n console.assert(value);\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,IAAI,KAAK;IACvB,QAAQ,MAAM,CAAC;AACjB","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_shebang_input_d5e8dcd4._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_shebang_input_d5e8dcd4._.js.map index e934be16a662c..77a420c49f059 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_shebang_input_d5e8dcd4._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/output/turbopack_crates_turbopack-tests_tests_snapshot_basic_shebang_input_d5e8dcd4._.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/input/index.js"],"sourcesContent":["#!/usr/bin/env node\n\nimport { foo } from 'foo'\n\nfoo(true)\n"],"names":[],"mappings":";AAEA;;AAEA,CAAA,GAAA,qNAAA,CAAA,MAAG,AAAD,EAAE"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/input/index.js"],"sourcesContent":["#!/usr/bin/env node\n\nimport { foo } from 'foo'\n\nfoo(true)\n"],"names":[],"mappings":";AAEA;;AAEA,IAAA,4NAAG,EAAC"}}, {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/shebang/input/node_modules/foo/index.js"],"sourcesContent":["#!/usr/bin/env node\n\nexport function foo(value) {\n console.assert(value);\n}\n"],"names":[],"mappings":";;;AAEO,SAAS,IAAI,KAAK;IACvB,QAAQ,MAAM,CAAC;AACjB","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/4e721_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_9acd43f4._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/4e721_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_9acd43f4._.js.map index 5716dc8f694b2..27a679c9c2ca6 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/4e721_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_9acd43f4._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/4e721_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_9acd43f4._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/Actions.js"],"sourcesContent":["// import() doesn't care about whether a module is an async module or not\nconst UserApi = import('./UserAPI.js')\n\nexport const CreateUserAction = async (name) => {\n console.log('Creating user', name)\n // These are normal awaits, because they are in an async function\n const { createUser } = await UserApi\n await createUser(name)\n}\n\n// You can place import() where you like\n// Placing it at top-level will start loading and evaluating on\n// module evaluation.\n// see CreateUserAction above\n// Here: Connecting to the DB starts when the application starts\n// Placing it inside of an (async) function will start loading\n// and evaluating when the function is called for the first time\n// which basically makes it lazy-loaded.\n// see AlternativeCreateUserAction below\n// Here: Connecting to the DB starts when AlternativeCreateUserAction\n// is called\nexport const AlternativeCreateUserAction = async (name) => {\n const { createUser } = await import('./UserAPI.js')\n await createUser(name)\n}\n\n// Note: Using await import() at top-level doesn't make much sense\n// except in rare cases. It will import modules sequentially.\n"],"names":[],"mappings":"AAAA,yEAAyE;;;;;AACzE,MAAM;AAEC,MAAM,mBAAmB,OAAO;IACrC,QAAQ,GAAG,CAAC,iBAAiB;IAC7B,iEAAiE;IACjE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM;IAC7B,MAAM,WAAW;AACnB;AAaO,MAAM,8BAA8B,OAAO;IAChD,MAAM,EAAE,UAAU,EAAE,GAAG;IACvB,MAAM,WAAW;AACnB,EAEA,kEAAkE;CAClE,mEAAmE"}}, - {"offset": {"line": 27, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/index.js"],"sourcesContent":["import { CreateUserAction } from './Actions.js'\n;(async () => {\n await CreateUserAction('John')\n console.log('created user John')\n})()\n"],"names":[],"mappings":";AAAA;;AACC,CAAC;IACA,MAAM,CAAA,GAAA,8MAAA,CAAA,mBAAgB,AAAD,EAAE;IACvB,QAAQ,GAAG,CAAC;AACd,CAAC"}}] + {"offset": {"line": 27, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/index.js"],"sourcesContent":["import { CreateUserAction } from './Actions.js'\n;(async () => {\n await CreateUserAction('John')\n console.log('created user John')\n})()\n"],"names":[],"mappings":";AAAA;;AACC,CAAC;IACA,MAAM,IAAA,kOAAgB,EAAC;IACvB,QAAQ,GAAG,CAAC;AACd,CAAC"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/4e721_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_aa0a0c39._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/4e721_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_aa0a0c39._.js.map index 9f7271c4d83e9..77cad28c7293e 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/4e721_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_aa0a0c39._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/output/4e721_crates_turbopack-tests_tests_snapshot_basic_top-level-await_input_aa0a0c39._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 7, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/db-connection.js"],"sourcesContent":["const connectToDB = async (url) => {\n console.log('connecting to db', url)\n await new Promise((r) => setTimeout(r, 1000))\n}\n\n// This is a top-level-await\nawait connectToDB('my-sql://example.com')\n\nexport const dbCall = async (data) => {\n console.log('dbCall', data)\n // This is a normal await, because it's in an async function\n await new Promise((r) => setTimeout(r, 100))\n return 'fake data'\n}\n\nexport const close = () => {\n console.log('closes the DB connection')\n}\n"],"names":[],"mappings":";;;;AAAA,MAAM,cAAc,OAAO;IACzB,QAAQ,GAAG,CAAC,oBAAoB;IAChC,MAAM,IAAI,QAAQ,CAAC,IAAM,WAAW,GAAG;AACzC;AAEA,4BAA4B;AAC5B,MAAM,YAAY;AAEX,MAAM,SAAS,OAAO;IAC3B,QAAQ,GAAG,CAAC,UAAU;IACtB,4DAA4D;IAC5D,MAAM,IAAI,QAAQ,CAAC,IAAM,WAAW,GAAG;IACvC,OAAO;AACT;AAEO,MAAM,QAAQ;IACnB,QAAQ,GAAG,CAAC;AACd"}}, - {"offset": {"line": 33, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/UserAPI.js"],"sourcesContent":["import { dbCall } from './db-connection.js'\n\nexport const createUser = async (name) => {\n const command = `CREATE USER ${name}`\n // This is a normal await, because it's in an async function\n await dbCall({ command })\n}\n"],"names":[],"mappings":";;;AAAA;;;;;;AAEO,MAAM,aAAa,OAAO;IAC/B,MAAM,UAAU,CAAC,YAAY,EAAE,MAAM;IACrC,4DAA4D;IAC5D,MAAM,CAAA,GAAA,uNAAA,CAAA,SAAM,AAAD,EAAE;QAAE;IAAQ;AACzB"}}] + {"offset": {"line": 33, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/top-level-await/input/UserAPI.js"],"sourcesContent":["import { dbCall } from './db-connection.js'\n\nexport const createUser = async (name) => {\n const command = `CREATE USER ${name}`\n // This is a normal await, because it's in an async function\n await dbCall({ command })\n}\n"],"names":[],"mappings":";;;AAAA;;;;;;AAEO,MAAM,aAAa,OAAO;IAC/B,MAAM,UAAU,CAAC,YAAY,EAAE,MAAM;IACrC,4DAA4D;IAC5D,MAAM,IAAA,iOAAM,EAAC;QAAE;IAAQ;AACzB"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/output/turbopack_crates_turbopack-tests_tests_snapshot_css_css-modules_input_8f2e7f32._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/output/turbopack_crates_turbopack-tests_tests_snapshot_css_css-modules_input_8f2e7f32._.js.map index 0bbbad774cba7..510541d6c93a0 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/output/turbopack_crates_turbopack-tests_tests_snapshot_css_css-modules_input_8f2e7f32._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/output/turbopack_crates_turbopack-tests_tests_snapshot_css_css-modules_input_8f2e7f32._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/input/style.module.css [test] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"module-style\": \"style-module__cu3fEW__module-style\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}}, - {"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/input/index.js"],"sourcesContent":["import style from './style.module.css'\n\nconsole.log(style, import('./style.module.css'))\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,+MAAA,CAAA,UAAK"}}] + {"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css-modules/input/index.js"],"sourcesContent":["import style from './style.module.css'\n\nconsole.log(style, import('./style.module.css'))\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,0NAAK"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/css/css/output/turbopack_crates_turbopack-tests_tests_snapshot_css_css_input_6dc4af09._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/css/css/output/turbopack_crates_turbopack-tests_tests_snapshot_css_css_input_6dc4af09._.js.map index 7e2a5788a3104..f7d0acd7438a4 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/css/css/output/turbopack_crates_turbopack-tests_tests_snapshot_css_css_input_6dc4af09._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/css/css/output/turbopack_crates_turbopack-tests_tests_snapshot_css_css_input_6dc4af09._.js.map @@ -3,6 +3,6 @@ "sources": [], "sections": [ {"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/style.module.css [test] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"another-composed-module-style\": \"style-module__Iu_hLa__another-composed-module-style\" + \" \" + __turbopack_context__.i(\"[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.module.css [test] (css module)\")[\"foo-module-style\"],\n \"composed-module-style\": \"style-module__Iu_hLa__composed-module-style\" + \" \" + __turbopack_context__.i(\"[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.module.css [test] (css module)\")[\"foo-module-style\"],\n \"inner\": \"style-module__Iu_hLa__inner\",\n \"module-style\": \"style-module__Iu_hLa__module-style\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA"}}, - {"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/index.js"],"sourcesContent":["import 'foo/style.css'\nimport 'foo'\nimport './style.css'\nimport fooStyle from 'foo/style.module.css'\nimport style from './style.module.css'\n\nconsole.log(style, fooStyle, import('foo'))\n"],"names":[],"mappings":";AAGA;AACA;;;;;;AAEA,QAAQ,GAAG,CAAC,oMAAA,CAAA,UAAK,EAAE,2NAAA,CAAA,UAAQ"}}, + {"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/index.js"],"sourcesContent":["import 'foo/style.css'\nimport 'foo'\nimport './style.css'\nimport fooStyle from 'foo/style.module.css'\nimport style from './style.module.css'\n\nconsole.log(style, fooStyle, import('foo'))\n"],"names":[],"mappings":";AAGA;AACA;;;;;;AAEA,QAAQ,GAAG,CAAC,+MAAK,EAAE,sOAAQ"}}, {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/css/input/node_modules/foo/style.module.css [test] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"foo-module-style\": \"style-module__CEkn7G__foo-module-style\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/css/embed-url/output/turbopack_crates_turbopack-tests_tests_snapshot_css_embed-url_input_4242144a._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/css/embed-url/output/turbopack_crates_turbopack-tests_tests_snapshot_css_embed-url_input_4242144a._.js.map index 69eac29894202..46a253898e878 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/css/embed-url/output/turbopack_crates_turbopack-tests_tests_snapshot_css_embed-url_input_4242144a._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/css/embed-url/output/turbopack_crates_turbopack-tests_tests_snapshot_css_embed-url_input_4242144a._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/embed-url/input/style.module.css [test] (css module)"],"sourcesContent":["__turbopack_context__.v({\n \"module-style\": \"style-module__3oVw9q__module-style\",\n});\n"],"names":[],"mappings":"AAAA;AACA;AACA"}}, - {"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/embed-url/input/index.js"],"sourcesContent":["import style from './style.module.css'\nimport './style.css'\n\nconsole.log(style, import('./style.module.css'), import('./style.css'))\n"],"names":[],"mappings":";AAAA;;;AAGA,QAAQ,GAAG,CAAC,6MAAA,CAAA,UAAK"}}] + {"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/embed-url/input/index.js"],"sourcesContent":["import style from './style.module.css'\nimport './style.css'\n\nconsole.log(style, import('./style.module.css'), import('./style.css'))\n"],"names":[],"mappings":";AAAA;;;AAGA,QAAQ,GAAG,CAAC,wNAAK"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/css/minification/output/turbopack_crates_turbopack-tests_tests_snapshot_css_minification_input_cd94b040._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/css/minification/output/turbopack_crates_turbopack-tests_tests_snapshot_css_minification_input_cd94b040._.js.map index 41c13b3607e80..2a94a1ed4fe9f 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/css/minification/output/turbopack_crates_turbopack-tests_tests_snapshot_css_minification_input_cd94b040._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/css/minification/output/turbopack_crates_turbopack-tests_tests_snapshot_css_minification_input_cd94b040._.js.map @@ -1 +1 @@ -{"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/minification/input/style.module.css [test] (css module)","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/minification/input/index.js"],"sourcesContent":["__turbopack_context__.v({\n \"inner\": \"style-module__1v6dfa__inner\",\n \"module-style\": \"style-module__1v6dfa__module-style\",\n});\n","import './style.css'\nimport style from './style.module.css'\n\nconsole.log(style)\n"],"names":[],"mappings":"iRAAA,EAAA,CAAA,CAAA,CACA,MAAA,8BACA,eAAA,oCACA,6ICAA,QAAQ,GAAG,CAFX,AAEY,EAFZ,CAAA,CAAA,yHAEY,OAAK,yEAAL"} \ No newline at end of file +{"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/minification/input/style.module.css [test] (css module)","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/css/minification/input/index.js"],"sourcesContent":["__turbopack_context__.v({\n \"inner\": \"style-module__1v6dfa__inner\",\n \"module-style\": \"style-module__1v6dfa__module-style\",\n});\n","import './style.css'\nimport style from './style.module.css'\n\nconsole.log(style)\n"],"names":[],"mappings":"iRAAA,EAAA,CAAA,CAAA,CACA,MAAA,8BACA,eAAA,oCACA,6ICAA,QAAQ,GAAG,CAFX,AAEY,EAFZ,CAAA,CAAA,yHAEY,OAAK"} \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-request/very-dynamic/output/4c35f_tests_snapshot_dynamic-request_very-dynamic_input_index_c4e3aa79.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-request/very-dynamic/output/4c35f_tests_snapshot_dynamic-request_very-dynamic_input_index_c4e3aa79.js.map index fad80ea87f2b1..a72b7bf95f606 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-request/very-dynamic/output/4c35f_tests_snapshot_dynamic-request_very-dynamic_input_index_c4e3aa79.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-request/very-dynamic/output/4c35f_tests_snapshot_dynamic-request_very-dynamic_input_index_c4e3aa79.js.map @@ -2,5 +2,5 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-request/very-dynamic/input/index.js"],"sourcesContent":["import child_process from 'node:child_process'\nimport fs, { readFileSync } from 'node:fs'\n\nconst unknown = Math.random()\n\nchild_process.spawnSync(unknown)\nchild_process.spawnSync('node', unknown)\nchild_process.spawnSync('node', [unknown, unknown])\n\nrequire(unknown)\n\nimport(unknown)\n\nfs.readFileSync(unknown)\nreadFileSync(unknown)\n\nnew URL(unknown, import.meta.url)\n"],"names":[],"mappings":";AAAA;AACA;;;;;;;;AAEA,MAAM,UAAU,KAAK,MAAM;AAE3B,mDAAA,CAAA,UAAa,CAAC,SAAS,CAAC;AACxB,mDAAA,CAAA,UAAa,CAAC,SAAS,CAAC,QAAQ;AAChC,mDAAA,CAAA,UAAa,CAAC,SAAS,CAAC,QAAQ;IAAC;IAAS;CAAQ;;;;;;;;;;;AAMlD,wCAAA,CAAA,UAAE,CAAC,YAAY,CAAC;AAChB,CAAA,GAAA,wCAAA,CAAA,eAAY,AAAD,EAAE;AAEb,IAAI,IAAI,SAAS,8BAAY,GAAG"}}] + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/dynamic-request/very-dynamic/input/index.js"],"sourcesContent":["import child_process from 'node:child_process'\nimport fs, { readFileSync } from 'node:fs'\n\nconst unknown = Math.random()\n\nchild_process.spawnSync(unknown)\nchild_process.spawnSync('node', unknown)\nchild_process.spawnSync('node', [unknown, unknown])\n\nrequire(unknown)\n\nimport(unknown)\n\nfs.readFileSync(unknown)\nreadFileSync(unknown)\n\nnew URL(unknown, import.meta.url)\n"],"names":[],"mappings":";AAAA;AACA;;;;;;;;AAEA,MAAM,UAAU,KAAK,MAAM;AAE3B,8DAAa,CAAC,SAAS,CAAC;AACxB,8DAAa,CAAC,SAAS,CAAC,QAAQ;AAChC,8DAAa,CAAC,SAAS,CAAC,QAAQ;IAAC;IAAS;CAAQ;;;;;;;;;;;AAMlD,mDAAE,CAAC,YAAY,CAAC;AAChB,IAAA,wDAAY,EAAC;AAEb,IAAI,IAAI,SAAS,8BAAY,GAAG"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_6fdc60d8._.js b/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_6fdc60d8._.js index 3ad666f8415be..b921df11acbdb 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_6fdc60d8._.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_6fdc60d8._.js @@ -10,7 +10,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ; ; ; -const StyledButton = /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$emotion$2f$styled$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__["default"])("button", { +const StyledButton = (0, /*#__PURE__*/ __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$node_modules$2f40$emotion$2f$styled$2f$index$2e$js__$5b$test$5d$__$28$ecmascript$29$__["default"])("button", { target: "e14dbx1z0" })("background:blue;"); function ClassNameButton({ children }) { diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_6fdc60d8._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_6fdc60d8._.js.map index 73d024ecbb543..9e59baf66e4c7 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_6fdc60d8._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/output/turbopack_crates_turbopack-tests_tests_snapshot_6fdc60d8._.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/input/index.js"],"sourcesContent":["/** @jsxImportSource @emotion/react */\n\nimport { jsx } from '@emotion/react'\nimport styled from '@emotion/styled'\n\nconst StyledButton = styled.button`\n background: blue;\n`\n\nfunction ClassNameButton({ children }) {\n return (\n \n {children}\n \n )\n}\n\nconsole.log(StyledButton, ClassNameButton)\n"],"names":[],"mappings":"AAAA,oCAAoC;;AAEpC;AACA;;;;AAEA,MAAM,6BAAe,CAAA,GAAA,wMAAA,CAAA,UAAM,AAAD;;;AAI1B,SAAS,gBAAgB,EAAE,QAAQ,EAAE;IACnC,qBACE,uOAAC;QACC,WAAW,GAAG,CAAC;;MAEf,CAAC;kBAEA;;;;;;AAGP;AAEA,QAAQ,GAAG,CAAC,cAAc"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/emotion/emotion/input/index.js"],"sourcesContent":["/** @jsxImportSource @emotion/react */\n\nimport { jsx } from '@emotion/react'\nimport styled from '@emotion/styled'\n\nconst StyledButton = styled.button`\n background: blue;\n`\n\nfunction ClassNameButton({ children }) {\n return (\n \n {children}\n \n )\n}\n\nconsole.log(StyledButton, ClassNameButton)\n"],"names":[],"mappings":"AAAA,oCAAoC;;AAEpC;AACA;;;;AAEA,MAAM,iCAAe,mNAAM;;;AAI3B,SAAS,gBAAgB,EAAE,QAAQ,EAAE;IACnC,qBACE,uOAAC;QACC,WAAW,GAAG,CAAC;;MAEf,CAAC;kBAEA;;;;;;AAGP;AAEA,QAAQ,GAAG,CAAC,cAAc"}}, {"offset": {"line": 32, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/jsx-dev-runtime.js"],"sourcesContent":["export function jsxDEV() {\n return 'purposefully empty stub for @emotion/react/jsx-dev-runtime.js'\n}\n"],"names":[],"mappings":";;;AAAO,SAAS;IACd,OAAO;AACT","ignoreList":[0]}}, {"offset": {"line": 42, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/react/index.js"],"sourcesContent":["export function jsx() {\n return 'purposefully empty stub for @emotion/react/index.js'\n}\n"],"names":[],"mappings":";;;AAAO,SAAS;IACd,OAAO;AACT","ignoreList":[0]}}, {"offset": {"line": 53, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/@emotion/styled/index.js"],"sourcesContent":["\"purposefully empty stub\";\n\"@emtion/styled/index.js\";\n"],"names":[],"mappings":"AAAA;AACA","ignoreList":[0]}}] diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/output/4e721_crates_turbopack-tests_tests_snapshot_imports_duplicate-binding_input_8498b7ee._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/output/4e721_crates_turbopack-tests_tests_snapshot_imports_duplicate-binding_input_8498b7ee._.js.map index 7cc38935ed216..d3879f03c4c75 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/output/4e721_crates_turbopack-tests_tests_snapshot_imports_duplicate-binding_input_8498b7ee._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/output/4e721_crates_turbopack-tests_tests_snapshot_imports_duplicate-binding_input_8498b7ee._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/input/table.js"],"sourcesContent":["export const Table = () => {\n return 'table'\n}\n"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ;IACnB,OAAO;AACT"}}, - {"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/input/index.js"],"sourcesContent":["import { Table } from './table'\n\nexport function Table() {\n console.log(Table)\n}\n"],"names":[],"mappings":";;;AAAA;;AAEO,SAAS;IACd,QAAQ,GAAG,CAAC,6MAAA,CAAA,QAAK;AACnB"}}] + {"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/duplicate-binding/input/index.js"],"sourcesContent":["import { Table } from './table'\n\nexport function Table() {\n console.log(Table)\n}\n"],"names":[],"mappings":";;;AAAA;;AAEO,SAAS;IACd,QAAQ,GAAG,CAAC,sNAAK;AACnB"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_json_input_52abdb3f._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_json_input_52abdb3f._.js.map index c41e30774d52c..72f8a1b404d20 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_json_input_52abdb3f._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_json_input_52abdb3f._.js.map @@ -2,5 +2,5 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/index.js"],"sourcesContent":["import pkg from './package.json'\nconsole.log(pkg.name)\nimport invalid from './invalid.json'\nconsole.log(invalid['this-is'])\n"],"names":[],"mappings":";AAAA;AAEA;;AADA,QAAQ,GAAG,CAAC,6KAAA,CAAA,UAAG,CAAC,IAAI;;AAEpB,QAAQ,GAAG,CAAC,6KAAA,CAAA,UAAO,CAAC,UAAU"}}] + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/index.js"],"sourcesContent":["import pkg from './package.json'\nconsole.log(pkg.name)\nimport invalid from './invalid.json'\nconsole.log(invalid['this-is'])\n"],"names":[],"mappings":";AAAA;AAEA;;AADA,QAAQ,GAAG,CAAC,wLAAG,CAAC,IAAI;;AAEpB,QAAQ,GAAG,CAAC,wLAAO,CAAC,UAAU"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/imports/order/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_order_input_152f317f._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/imports/order/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_order_input_152f317f._.js.map index 963684089e1a1..467ff37c2e677 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/imports/order/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_order_input_152f317f._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/imports/order/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_order_input_152f317f._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/order/input/posts.ts"],"sourcesContent":["export default {\n js: true,\n}\n"],"names":[],"mappings":";;;uCAAe;IACb,IAAI;AACN"}}, - {"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/order/input/index.js"],"sourcesContent":["import posts from './posts'\n\nconsole.log(posts.js)\nif (!posts.js) {\n process.exit(1)\n}\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,8LAAA,CAAA,UAAK,CAAC,EAAE;AACpB,IAAI,CAAC,8LAAA,CAAA,UAAK,CAAC,EAAE,EAAE;IACb,QAAQ,IAAI,CAAC;AACf"}}] + {"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/order/input/index.js"],"sourcesContent":["import posts from './posts'\n\nconsole.log(posts.js)\nif (!posts.js) {\n process.exit(1)\n}\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,yMAAK,CAAC,EAAE;AACpB,IAAI,CAAC,yMAAK,CAAC,EAAE,EAAE;IACb,QAAQ,IAAI,CAAC;AACf"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/imports/static-and-dynamic/output/4e721_crates_turbopack-tests_tests_snapshot_imports_static-and-dynamic_input_ab9cac73._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/imports/static-and-dynamic/output/4e721_crates_turbopack-tests_tests_snapshot_imports_static-and-dynamic_input_ab9cac73._.js.map index 4ca096593af37..72ba6031e7d04 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/imports/static-and-dynamic/output/4e721_crates_turbopack-tests_tests_snapshot_imports_static-and-dynamic_input_ab9cac73._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/imports/static-and-dynamic/output/4e721_crates_turbopack-tests_tests_snapshot_imports_static-and-dynamic_input_ab9cac73._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/static-and-dynamic/input/vercel.mjs"],"sourcesContent":["export default 'turbopack'\n"],"names":[],"mappings":";;;uCAAe"}}, - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/static-and-dynamic/input/index.js"],"sourcesContent":["import img from './vercel.mjs'\nconsole.log(img)\n\nimport('./vercel.mjs').then(console.log)\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC,mNAAA,CAAA,UAAG;AAEf,4LAAuB,IAAI,CAAC,QAAQ,GAAG"}}] + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/static-and-dynamic/input/index.js"],"sourcesContent":["import img from './vercel.mjs'\nconsole.log(img)\n\nimport('./vercel.mjs').then(console.log)\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC,8NAAG;AAEf,4LAAuB,IAAI,CAAC,QAAQ,GAAG"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/imports/static/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_static_input_89ddd9a2._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/imports/static/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_static_input_89ddd9a2._.js.map index 5153de6f78968..adc8b5138ba2d 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/imports/static/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_static_input_89ddd9a2._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/imports/static/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_static_input_89ddd9a2._.js.map @@ -2,5 +2,5 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 8, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/static/input/index.js"],"sourcesContent":["import img from \"./vercel.svg\";\nconsole.log(img);\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC,+LAAA,CAAA,UAAG"}}] + {"offset": {"line": 8, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/static/input/index.js"],"sourcesContent":["import img from \"./vercel.svg\";\nconsole.log(img);\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC,0MAAG"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/output/b1abf_turbopack-tests_tests_snapshot_imports_subpath-imports-nested_input_2e0531bf._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/output/b1abf_turbopack-tests_tests_snapshot_imports_subpath-imports-nested_input_2e0531bf._.js.map index ddbb749f665c4..3ad0dbde34aa2 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/output/b1abf_turbopack-tests_tests_snapshot_imports_subpath-imports-nested_input_2e0531bf._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/output/b1abf_turbopack-tests_tests_snapshot_imports_subpath-imports-nested_input_2e0531bf._.js.map @@ -3,6 +3,6 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/input/foo.js"],"sourcesContent":["export default 'foo'\n"],"names":[],"mappings":";;;uCAAe"}}, - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/input/nested/index.js"],"sourcesContent":["import foo from '#foo'\nexport default foo\n"],"names":[],"mappings":";;;AAAA;;uCACe,mNAAA,CAAA,UAAG"}}, - {"offset": {"line": 23, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/input/index.js"],"sourcesContent":["import foo from './nested'\n\nconsole.log(foo)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,+NAAA,CAAA,UAAG"}}] + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/input/nested/index.js"],"sourcesContent":["import foo from '#foo'\nexport default foo\n"],"names":[],"mappings":";;;AAAA;;uCACe,8NAAG"}}, + {"offset": {"line": 23, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports-nested/input/index.js"],"sourcesContent":["import foo from './nested'\n\nconsole.log(foo)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,0OAAG"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/output/4e721_crates_turbopack-tests_tests_snapshot_imports_subpath-imports_input_1e655205._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/output/4e721_crates_turbopack-tests_tests_snapshot_imports_subpath-imports_input_1e655205._.js.map index b213b9e9eeb07..c381f36ffda46 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/output/4e721_crates_turbopack-tests_tests_snapshot_imports_subpath-imports_input_1e655205._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/output/4e721_crates_turbopack-tests_tests_snapshot_imports_subpath-imports_input_1e655205._.js.map @@ -7,5 +7,5 @@ {"offset": {"line": 21, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/input/pat.js"],"sourcesContent":["export default 'pat'\n"],"names":[],"mappings":";;;uCAAe"}}, {"offset": {"line": 29, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/input/import.mjs"],"sourcesContent":["export default 'import'\n"],"names":[],"mappings":";;;uCAAe"}}, {"offset": {"line": 38, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/input/require.cjs"],"sourcesContent":["module.exports = 'require'\n"],"names":[],"mappings":"AAAA,OAAO,OAAO,GAAG"}}, - {"offset": {"line": 43, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/input/index.js"],"sourcesContent":["import foo from '#foo'\nimport dep from '#dep'\nimport pattern from '#pattern/pat.js'\nimport conditionalImport from '#conditional'\nconst conditionalRequire = require('#conditional')\n\nconsole.log(foo, dep, pattern, conditionalImport, conditionalRequire)\n"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;;;;;AACA,MAAM;AAEN,QAAQ,GAAG,CAAC,yMAAA,CAAA,UAAG,EAAE,kNAAA,CAAA,UAAG,EAAE,yMAAA,CAAA,UAAO,EAAE,6MAAA,CAAA,UAAiB,EAAE"}}] + {"offset": {"line": 43, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/subpath-imports/input/index.js"],"sourcesContent":["import foo from '#foo'\nimport dep from '#dep'\nimport pattern from '#pattern/pat.js'\nimport conditionalImport from '#conditional'\nconst conditionalRequire = require('#conditional')\n\nconsole.log(foo, dep, pattern, conditionalImport, conditionalRequire)\n"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;;;;;AACA,MAAM;AAEN,QAAQ,GAAG,CAAC,oNAAG,EAAE,6NAAG,EAAE,oNAAO,EAAE,wNAAiB,EAAE"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/output/4c35f_tests_snapshot_intermediate-tree-shake_reexport-with-locals_input_6ca4cc64._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/output/4c35f_tests_snapshot_intermediate-tree-shake_reexport-with-locals_input_6ca4cc64._.js.map index 04c99ccca1ea1..eab8c0a16bbbf 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/output/4c35f_tests_snapshot_intermediate-tree-shake_reexport-with-locals_input_6ca4cc64._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/output/4c35f_tests_snapshot_intermediate-tree-shake_reexport-with-locals_input_6ca4cc64._.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/input/index.js"],"sourcesContent":["import { local } from 'lib'\n\nlocal()\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,CAAA,GAAA,gRAAA,CAAA,QAAK,AAAD"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/input/index.js"],"sourcesContent":["import { local } from 'lib'\n\nlocal()\n"],"names":[],"mappings":";AAAA;AAAA;;AAEA,IAAA,yRAAK"}}, {"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/input/node_modules/lib/unused.js"],"sourcesContent":["export function unusedStar() {}\n"],"names":[],"mappings":";AAAO,SAAS,cAAc","ignoreList":[0]}}, {"offset": {"line": 20, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/input/node_modules/lib/unused-star.js"],"sourcesContent":["export function unused() {}\n"],"names":[],"mappings":";AAAO,SAAS,UAAU","ignoreList":[0]}}, {"offset": {"line": 26, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/reexport-with-locals/input/node_modules/lib/index.js"],"sourcesContent":["export { unused } from './unused.js'\nexport * from './unused-star.js'\n\nfunction local() {\n console.log('This is a local function')\n}\nfunction localUnused() {\n console.log('This is a local unused function')\n}\n\nexport { local, localUnused }\n"],"names":[],"mappings":";;;AAAA;AACA;;;AAEA,SAAS;IACP,QAAQ,GAAG,CAAC;AACd;AACA,SAAS;IACP,QAAQ,GAAG,CAAC;AACd","ignoreList":[0]}}] diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/rename-side-effect-free-facade/output/457d9_snapshot_intermediate-tree-shake_rename-side-effect-free-facade_input_71bae14d._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/rename-side-effect-free-facade/output/457d9_snapshot_intermediate-tree-shake_rename-side-effect-free-facade_input_71bae14d._.js.map index cdaf305fa22c2..5944289fcaa79 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/rename-side-effect-free-facade/output/457d9_snapshot_intermediate-tree-shake_rename-side-effect-free-facade_input_71bae14d._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/rename-side-effect-free-facade/output/457d9_snapshot_intermediate-tree-shake_rename-side-effect-free-facade_input_71bae14d._.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/rename-side-effect-free-facade/input/index.js"],"sourcesContent":["import { a0 } from 'lib'\n\nconsole.log(a0)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,uSAAA,CAAA,KAAE"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/rename-side-effect-free-facade/input/index.js"],"sourcesContent":["import { a0 } from 'lib'\n\nconsole.log(a0)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,6SAAE"}}, {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/rename-side-effect-free-facade/input/node_modules/lib/a.js"],"sourcesContent":["export const a = 'a'\nexport const a_unused = 'a_unused'\n"],"names":[],"mappings":";;;AAAO,MAAM,IAAI;AACV,MAAM,WAAW","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/tree-shake-test-1/output/4c35f_tests_snapshot_intermediate-tree-shake_tree-shake-test-1_input_80df1e23._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/tree-shake-test-1/output/4c35f_tests_snapshot_intermediate-tree-shake_tree-shake-test-1_input_80df1e23._.js.map index cf9eeed53a5a6..7be01967ae20e 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/tree-shake-test-1/output/4c35f_tests_snapshot_intermediate-tree-shake_tree-shake-test-1_input_80df1e23._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/tree-shake-test-1/output/4c35f_tests_snapshot_intermediate-tree-shake_tree-shake-test-1_input_80df1e23._.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["import { getCat } from 'lib'\n\nconsole.log(`I like ${getCat()}`)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,CAAC,OAAO,EAAE,CAAA,GAAA,gQAAA,CAAA,SAAM,AAAD,KAAK"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/tree-shake-test-1/input/index.js"],"sourcesContent":["import { getCat } from 'lib'\n\nconsole.log(`I like ${getCat()}`)\n"],"names":[],"mappings":";AAAA;;AAEA,QAAQ,GAAG,CAAC,CAAC,OAAO,EAAE,IAAA,0QAAM,KAAI"}}, {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/intermediate-tree-shake/tree-shake-test-1/input/node_modules/lib/index.js"],"sourcesContent":["\nlet cat = \"cat\";\nlet dog = \"dog\";\n\nexport function getChimera() {\n return cat + dog;\n}\n\nexport function getCat() {\n return cat;\n}\n\nexport function getDog() {\n return dog;\n}\n\n"],"names":[],"mappings":";;;AACA,IAAI,MAAM;AACV,IAAI,MAAM;AAEH,SAAS;IACd,OAAO,MAAM;AACf;AAEO,SAAS;IACd,OAAO;AACT;AAEO,SAAS;IACd,OAAO;AACT","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_dynamic/output/4e721_crates_turbopack-tests_tests_snapshot_node_spawn_dynamic_input_d33fdf1c._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_dynamic/output/4e721_crates_turbopack-tests_tests_snapshot_node_spawn_dynamic_input_d33fdf1c._.js.map index d511e5f1c2443..a45a3299298c4 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_dynamic/output/4e721_crates_turbopack-tests_tests_snapshot_node_spawn_dynamic_input_d33fdf1c._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_dynamic/output/4e721_crates_turbopack-tests_tests_snapshot_node_spawn_dynamic_input_d33fdf1c._.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_dynamic/input/index.js"],"sourcesContent":["import { spawn } from 'child_process'\n\nconst program = ['ls']\nconst proc = spawn(program[0], ['-la'])\n"],"names":[],"mappings":";AAAA;;AAEA,MAAM,UAAU;IAAC;CAAK;AACtB,MAAM,OAAO,CAAA,GAAA,oOAAA,CAAA,QAAK,AAAD,EAAE,OAAO,CAAC,EAAE,EAAE;IAAC;CAAM"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_dynamic/input/index.js"],"sourcesContent":["import { spawn } from 'child_process'\n\nconst program = ['ls']\nconst proc = spawn(program[0], ['-la'])\n"],"names":[],"mappings":";AAAA;;AAEA,MAAM,UAAU;IAAC;CAAK;AACtB,MAAM,OAAO,IAAA,6OAAK,EAAC,OAAO,CAAC,EAAE,EAAE;IAAC;CAAM"}}, {"offset": {"line": 18, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_dynamic/input/node_modules/child_process/index.js"],"sourcesContent":["export function spawn(cmd, args) {\n //\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,MAAM,GAAG,EAAE,IAAI;AAC7B,EAAE;AACJ","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_node_eval/output/4e721_crates_turbopack-tests_tests_snapshot_node_spawn_node_eval_input_bf21d136._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_node_eval/output/4e721_crates_turbopack-tests_tests_snapshot_node_spawn_node_eval_input_bf21d136._.js.map index 37a6d1de4c103..31cb51bbd30e0 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_node_eval/output/4e721_crates_turbopack-tests_tests_snapshot_node_spawn_node_eval_input_bf21d136._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_node_eval/output/4e721_crates_turbopack-tests_tests_snapshot_node_spawn_node_eval_input_bf21d136._.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_node_eval/input/index.js"],"sourcesContent":["import { spawn } from 'child_process'\n\nlet x = spawn(process.argv[0], ['-e', \"console.log('foo');\"])\n"],"names":[],"mappings":";AAAA;;AAEA,IAAI,IAAI,CAAA,GAAA,sOAAA,CAAA,QAAK,AAAD,EAAE,QAAQ,IAAI,CAAC,EAAE,EAAE;IAAC;IAAM;CAAsB"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_node_eval/input/index.js"],"sourcesContent":["import { spawn } from 'child_process'\n\nlet x = spawn(process.argv[0], ['-e', \"console.log('foo');\"])\n"],"names":[],"mappings":";AAAA;;AAEA,IAAI,IAAI,IAAA,+OAAK,EAAC,QAAQ,IAAI,CAAC,EAAE,EAAE;IAAC;IAAM;CAAsB"}}, {"offset": {"line": 16, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node/spawn_node_eval/input/node_modules/child_process/index.js"],"sourcesContent":["export function spawn(cmd, args) {\n //\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,MAAM,GAAG,EAAE,IAAI;AAC7B,EAAE;AACJ","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/output/b1abf_turbopack-tests_tests_snapshot_scope-hoisting_duplicate-imports_input_739fb2d3._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/output/b1abf_turbopack-tests_tests_snapshot_scope-hoisting_duplicate-imports_input_739fb2d3._.js.map index b8cb96824a2e2..7540d2176bfba 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/output/b1abf_turbopack-tests_tests_snapshot_scope-hoisting_duplicate-imports_input_739fb2d3._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/output/b1abf_turbopack-tests_tests_snapshot_scope-hoisting_duplicate-imports_input_739fb2d3._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 6, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/shared.js"],"sourcesContent":["module.exports = 'shared'\n"],"names":[],"mappings":"AAAA,OAAO,OAAO,GAAG"}}, - {"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/a.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/b.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/c.js"],"sourcesContent":["import shared from './shared.js'\n\nconsole.log('a', shared)\n","import './a.js'\nimport shared from './shared.js'\n\nconsole.log('a', shared)\n","import './b.js'\nimport shared from './shared.js'\n\nconsole.log('c', shared)\n"],"names":[],"mappings":";;;;;;;;;AAAA;;AAEA,QAAQ,GAAG,CAAC,KAAK,wNAAA,CAAA,UAAM;;;;ACCvB,QAAQ,GAAG,CAAC,KAAK,yNAAA,CAAA,UAAM;;;;ACAvB,QAAQ,GAAG,CAAC,KAAK,yNAAA,CAAA,UAAM"}}] + {"offset": {"line": 11, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/a.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/b.js","turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/duplicate-imports/input/c.js"],"sourcesContent":["import shared from './shared.js'\n\nconsole.log('a', shared)\n","import './a.js'\nimport shared from './shared.js'\n\nconsole.log('a', shared)\n","import './b.js'\nimport shared from './shared.js'\n\nconsole.log('c', shared)\n"],"names":[],"mappings":";;;;;;;;;AAAA;;AAEA,QAAQ,GAAG,CAAC,KAAK,mOAAM;;;;ACCvB,QAAQ,GAAG,CAAC,KAAK,oOAAM;;;;ACAvB,QAAQ,GAAG,CAAC,KAAK,oOAAM"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/output/4c35f_tests_snapshot_scope-hoisting_split-shared_input_x_inner_9793feec.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/output/4c35f_tests_snapshot_scope-hoisting_split-shared_input_x_inner_9793feec.js.map index 83c1fb5f646ed..befe68474f297 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/output/4c35f_tests_snapshot_scope-hoisting_split-shared_input_x_inner_9793feec.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/output/4c35f_tests_snapshot_scope-hoisting_split-shared_input_x_inner_9793feec.js.map @@ -2,5 +2,5 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/x/inner.js"],"sourcesContent":["import big from '../big'\nconsole.log('x', big)\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC,KAAK,yNAAA,CAAA,UAAG"}}] + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/x/inner.js"],"sourcesContent":["import big from '../big'\nconsole.log('x', big)\n"],"names":[],"mappings":";AAAA;;AACA,QAAQ,GAAG,CAAC,KAAK,oOAAG"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/output/4c35f_tests_snapshot_scope-hoisting_split-shared_input_y_middle_aa5cba2d.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/output/4c35f_tests_snapshot_scope-hoisting_split-shared_input_y_middle_aa5cba2d.js.map index 3a038f0c04cfc..b67b215f00329 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/output/4c35f_tests_snapshot_scope-hoisting_split-shared_input_y_middle_aa5cba2d.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/output/4c35f_tests_snapshot_scope-hoisting_split-shared_input_y_middle_aa5cba2d.js.map @@ -2,5 +2,5 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/y/inner.js"],"sourcesContent":["import big from '../big'\nconsole.log('y', big)\n"],"names":[],"mappings":";;;;;AAAA;;AACA,QAAQ,GAAG,CAAC,KAAK,yNAAA,CAAA,UAAG"}}] + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/scope-hoisting/split-shared/input/y/inner.js"],"sourcesContent":["import big from '../big'\nconsole.log('y', big)\n"],"names":[],"mappings":";;;;;AAAA;;AACA,QAAQ,GAAG,CAAC,KAAK,oOAAG"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/output/b1abf_turbopack-tests_tests_snapshot_source_maps_input-source-map_input_965ec6d6._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/output/b1abf_turbopack-tests_tests_snapshot_source_maps_input-source-map_input_965ec6d6._.js.map index 44ee70f9b4328..b7cf4cefeac0d 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/output/b1abf_turbopack-tests_tests_snapshot_source_maps_input-source-map_input_965ec6d6._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/output/b1abf_turbopack-tests_tests_snapshot_source_maps_input-source-map_input_965ec6d6._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"file":"turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/input/sourcemapped.js","sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/input/sourcemapped.ts"],"sourceRoot":"","sourcesContent":["// Compile with pnpm tsc turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map-merged/input/sourcemapped.ts --sourceMap --inlineSources --target esnext\n// tsc compile errors can be ignored\ntype Fn = () => T\nexport function runExternalSourceMapped(fn: Fn): T {\n return fn()\n}\n"],"names":[],"mappings":";;;AAGM,SAAU,uBAAuB,CAAI,EAAS;IAClD,OAAO,EAAE,EAAE,CAAA;AACb,CAAC"}}, - {"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/input/index.js"],"sourcesContent":["import { runExternalSourceMapped } from './sourcemapped.js'\n\nrunExternalSourceMapped()\n"],"names":[],"mappings":";AAAA;;AAEA,CAAA,GAAA,0NAAA,CAAA,0BAAuB,AAAD"}}] + {"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/source_maps/input-source-map/input/index.js"],"sourcesContent":["import { runExternalSourceMapped } from './sourcemapped.js'\n\nrunExternalSourceMapped()\n"],"names":[],"mappings":";AAAA;;AAEA,IAAA,qPAAuB"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/styled_components/styled_components/output/turbopack_crates_turbopack-tests_tests_snapshot_398e2526._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/styled_components/styled_components/output/turbopack_crates_turbopack-tests_tests_snapshot_398e2526._.js.map index ce8bd245e0d6a..9a98b8432c414 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/styled_components/styled_components/output/turbopack_crates_turbopack-tests_tests_snapshot_398e2526._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/styled_components/styled_components/output/turbopack_crates_turbopack-tests_tests_snapshot_398e2526._.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/styled_components/styled_components/input/index.js"],"sourcesContent":["import styled from 'styled-components'\n\nconst MyButton = styled.button`\n background: blue;\n`\n\nconsole.log(MyButton)\n"],"names":[],"mappings":";AAAA;;AAEA,MAAM,WAAW,yMAAA,CAAA,UAAM,CAAC,MAAM;;;EAAA,CAAC;;AAE/B,CAAC;AAED,QAAQ,GAAG,CAAC"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/styled_components/styled_components/input/index.js"],"sourcesContent":["import styled from 'styled-components'\n\nconst MyButton = styled.button`\n background: blue;\n`\n\nconsole.log(MyButton)\n"],"names":[],"mappings":";AAAA;;AAEA,MAAM,WAAW,oNAAM,CAAC,MAAM;;;EAAA,CAAC;;AAE/B,CAAC;AAED,QAAQ,GAAG,CAAC"}}, {"offset": {"line": 20, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/styled-components/index.js"],"sourcesContent":["\"purposefully empty stub\";\n\"styled-components/index.js\"\n"],"names":[],"mappings":"AAAA;AACA","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/output/turbopack_crates_turbopack-tests_tests_snapshot_b56e07c9._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/output/turbopack_crates_turbopack-tests_tests_snapshot_b56e07c9._.js.map index 12ad385ff9596..8f859da04e751 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/output/turbopack_crates_turbopack-tests_tests_snapshot_b56e07c9._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/output/turbopack_crates_turbopack-tests_tests_snapshot_b56e07c9._.js.map @@ -3,7 +3,7 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/input/packages/component/index.js"],"sourcesContent":["export default function MyApp() {\n return
    App
    \n}\n"],"names":[],"mappings":";;;;;AAAe,SAAS;IACtB,qBAAO,0NAAC;kBAAI;;;;;;AACd"}}, - {"offset": {"line": 23, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/input/packages/app/index.js"],"sourcesContent":["import MyApp from 'component'\nimport ThirdPartyComponent from 'third_party_component'\n\nconsole.log(MyApp, ThirdPartyComponent)\n"],"names":[],"mappings":";AAAA;AACA;;;AAEA,QAAQ,GAAG,CAAC,wOAAA,CAAA,UAAK,EAAE,wPAAA,CAAA,UAAmB"}}, + {"offset": {"line": 23, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/input/packages/app/index.js"],"sourcesContent":["import MyApp from 'component'\nimport ThirdPartyComponent from 'third_party_component'\n\nconsole.log(MyApp, ThirdPartyComponent)\n"],"names":[],"mappings":";AAAA;AACA;;;AAEA,QAAQ,GAAG,CAAC,mPAAK,EAAE,mQAAmB"}}, {"offset": {"line": 33, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/react/jsx-dev-runtime.js"],"sourcesContent":["export function jsxDEV() {\n return 'purposefully empty stub for react/jsx-dev-runtime.js'\n}\n"],"names":[],"mappings":";;;AAAO,SAAS;IACd,OAAO;AACT","ignoreList":[0]}}, {"offset": {"line": 43, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/input/node_modules/third_party_component/index.js"],"sourcesContent":["export default function ThirdPartyComponent() {\n return
    Should not be transformed
    ;\n}\n"],"names":[],"mappings":";;;AAAe,SAAS;IACtB,QAAQ,IAAI,yBAAyB,EAAE;AACzC","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/jsconfig-baseurl/output/b1abf_turbopack-tests_tests_snapshot_typescript_jsconfig-baseurl_input_50efc170._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/jsconfig-baseurl/output/b1abf_turbopack-tests_tests_snapshot_typescript_jsconfig-baseurl_input_50efc170._.js.map index cec438b78a3e2..813322e5c4fb7 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/jsconfig-baseurl/output/b1abf_turbopack-tests_tests_snapshot_typescript_jsconfig-baseurl_input_50efc170._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/jsconfig-baseurl/output/b1abf_turbopack-tests_tests_snapshot_typescript_jsconfig-baseurl_input_50efc170._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/jsconfig-baseurl/input/prop.js"],"sourcesContent":["export const prop = 1\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO"}}, - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/jsconfig-baseurl/input/index.js"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,8MAAA,CAAA,OAAS,EAAE,8MAAA,CAAA,OAAQ,EAAE,8MAAA,CAAA,OAAK"}}] + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/jsconfig-baseurl/input/index.js"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,sNAAS,EAAE,sNAAQ,EAAE,sNAAK"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-baseurl/output/b1abf_turbopack-tests_tests_snapshot_typescript_tsconfig-baseurl_input_88264193._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-baseurl/output/b1abf_turbopack-tests_tests_snapshot_typescript_tsconfig-baseurl_input_88264193._.js.map index 1f25de59d5eb9..a74ce907252a7 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-baseurl/output/b1abf_turbopack-tests_tests_snapshot_typescript_tsconfig-baseurl_input_88264193._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-baseurl/output/b1abf_turbopack-tests_tests_snapshot_typescript_tsconfig-baseurl_input_88264193._.js.map @@ -3,6 +3,6 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-baseurl/input/prop.ts"],"sourcesContent":["export const prop = 1\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO"}}, - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-baseurl/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nimport * as bar from 'bar'\n\nconsole.log(globalFoo, localFoo, atFoo, bar)\n"],"names":[],"mappings":";AAAA;AAIA;;;;;AAEA,QAAQ,GAAG,CAAC,8MAAA,CAAA,OAAS,EAAE,8MAAA,CAAA,OAAQ,EAAE,8MAAA,CAAA,OAAK,EAAE"}}, + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-baseurl/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nimport * as bar from 'bar'\n\nconsole.log(globalFoo, localFoo, atFoo, bar)\n"],"names":[],"mappings":";AAAA;AAIA;;;;;AAEA,QAAQ,GAAG,CAAC,sNAAS,EAAE,sNAAQ,EAAE,sNAAK,EAAE"}}, {"offset": {"line": 25, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-baseurl/input/node_modules/bar/index.js"],"sourcesContent":["export const bar = 'bar';\n"],"names":[],"mappings":";;;AAAO,MAAM,MAAM","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module-full-path/output/turbopack_crates_turbopack-tests_tests_snapshot_f038421b._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module-full-path/output/turbopack_crates_turbopack-tests_tests_snapshot_f038421b._.js.map index 8e22e4e43ebe9..31185890fdd8f 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module-full-path/output/turbopack_crates_turbopack-tests_tests_snapshot_f038421b._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module-full-path/output/turbopack_crates_turbopack-tests_tests_snapshot_f038421b._.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module-full-path/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,mMAAA,CAAA,OAAS,EAAE,mMAAA,CAAA,OAAQ,EAAE,mMAAA,CAAA,OAAK"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module-full-path/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,2MAAS,EAAE,2MAAQ,EAAE,2MAAK"}}, {"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/tsconfig-mod/prop.ts"],"sourcesContent":["export const prop = 1;\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module/output/turbopack_crates_turbopack-tests_tests_snapshot_cff3cff1._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module/output/turbopack_crates_turbopack-tests_tests_snapshot_cff3cff1._.js.map index da87be86a9001..0bee0d03cf95e 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module/output/turbopack_crates_turbopack-tests_tests_snapshot_cff3cff1._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module/output/turbopack_crates_turbopack-tests_tests_snapshot_cff3cff1._.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,mMAAA,CAAA,OAAS,EAAE,mMAAA,CAAA,OAAQ,EAAE,mMAAA,CAAA,OAAK"}}, + {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-module/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,2MAAS,EAAE,2MAAQ,EAAE,2MAAK"}}, {"offset": {"line": 15, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/node_modules/tsconfig-mod/prop.ts"],"sourcesContent":["export const prop = 1;\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO","ignoreList":[0]}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-relative-dir/output/4c35f_tests_snapshot_typescript_tsconfig-extends-relative-dir_input_ef6815c7._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-relative-dir/output/4c35f_tests_snapshot_typescript_tsconfig-extends-relative-dir_input_ef6815c7._.js.map index 12c63cbe49c09..d727fdbfdcd75 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-relative-dir/output/4c35f_tests_snapshot_typescript_tsconfig-extends-relative-dir_input_ef6815c7._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-relative-dir/output/4c35f_tests_snapshot_typescript_tsconfig-extends-relative-dir_input_ef6815c7._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-relative-dir/input/prop.ts"],"sourcesContent":["export const prop = 1\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO"}}, - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-relative-dir/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,iOAAA,CAAA,OAAS,EAAE,iOAAA,CAAA,OAAQ,EAAE,iOAAA,CAAA,OAAK"}}] + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-relative-dir/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,yOAAS,EAAE,yOAAQ,EAAE,yOAAK"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-without-ext/output/4c35f_tests_snapshot_typescript_tsconfig-extends-without-ext_input_fcdb4390._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-without-ext/output/4c35f_tests_snapshot_typescript_tsconfig-extends-without-ext_input_fcdb4390._.js.map index f6d9ae3e8dbf0..f14f18b803b32 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-without-ext/output/4c35f_tests_snapshot_typescript_tsconfig-extends-without-ext_input_fcdb4390._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-without-ext/output/4c35f_tests_snapshot_typescript_tsconfig-extends-without-ext_input_fcdb4390._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-without-ext/input/prop.ts"],"sourcesContent":["export const prop = 1\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO"}}, - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-without-ext/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,gOAAA,CAAA,OAAS,EAAE,gOAAA,CAAA,OAAQ,EAAE,gOAAA,CAAA,OAAK"}}] + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends-without-ext/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,wOAAS,EAAE,wOAAQ,EAAE,wOAAK"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends/output/b1abf_turbopack-tests_tests_snapshot_typescript_tsconfig-extends_input_39e68707._.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends/output/b1abf_turbopack-tests_tests_snapshot_typescript_tsconfig-extends_input_39e68707._.js.map index 9ad4dd2832721..0cb8e9ffd5050 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends/output/b1abf_turbopack-tests_tests_snapshot_typescript_tsconfig-extends_input_39e68707._.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends/output/b1abf_turbopack-tests_tests_snapshot_typescript_tsconfig-extends_input_39e68707._.js.map @@ -3,5 +3,5 @@ "sources": [], "sections": [ {"offset": {"line": 5, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends/input/prop.ts"],"sourcesContent":["export const prop = 1\n"],"names":[],"mappings":";;;AAAO,MAAM,OAAO"}}, - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,8MAAA,CAAA,OAAS,EAAE,8MAAA,CAAA,OAAQ,EAAE,8MAAA,CAAA,OAAK"}}] + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/typescript/tsconfig-extends/input/index.ts"],"sourcesContent":["import { prop as globalFoo } from 'foo'\nimport { prop as localFoo } from './foo'\nimport { prop as atFoo } from '@/foo'\n\nconsole.log(globalFoo, localFoo, atFoo)\n"],"names":[],"mappings":";AAAA;;;;AAIA,QAAQ,GAAG,CAAC,sNAAS,EAAE,sNAAQ,EAAE,sNAAK"}}] } \ No newline at end of file