Unverified Commit 382b79bc authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[sourcemaps] Consistent cursor columns (#81375)

Co-authored-by: 's avatarNiklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
parent a04a5efe
...@@ -57,7 +57,7 @@ async function getSourceFrame( ...@@ -57,7 +57,7 @@ async function getSourceFrame(
input: any, input: any,
fileName: any, fileName: any,
compilation: any compilation: any
): Promise<{ frame: string; lineNumber: string; column: string }> { ): Promise<{ frame: string; line1: string; column1: string }> {
try { try {
const loc = const loc =
input.loc || input.dependencies.map((d: any) => d.loc).filter(Boolean)[0] input.loc || input.dependencies.map((d: any) => d.loc).filter(Boolean)[0]
...@@ -83,21 +83,21 @@ async function getSourceFrame( ...@@ -83,21 +83,21 @@ async function getSourceFrame(
arguments: [], arguments: [],
file: fileName, file: fileName,
methodName: '', methodName: '',
lineNumber: loc.start.line, line1: loc.start.line,
// loc is 0-based but columns in stack frames are 1-based. // 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 { return {
frame: result?.originalCodeFrame ?? '', frame: result?.originalCodeFrame ?? '',
lineNumber: result?.originalStackFrame?.lineNumber?.toString() ?? '', line1: result?.originalStackFrame?.line1?.toString() ?? '',
column: result?.originalStackFrame?.column?.toString() ?? '', column1: result?.originalStackFrame?.column1?.toString() ?? '',
} }
} }
} catch {} } catch {}
return { frame: '', lineNumber: '', column: '' } return { frame: '', line1: '', column1: '' }
} }
function getFormattedFileName( function getFormattedFileName(
...@@ -141,7 +141,7 @@ export async function getNotFoundError( ...@@ -141,7 +141,7 @@ export async function getNotFoundError(
} }
try { try {
const { frame, lineNumber, column } = await getSourceFrame( const { frame, line1, column1 } = await getSourceFrame(
input, input,
fileName, fileName,
compilation compilation
...@@ -181,8 +181,8 @@ export async function getNotFoundError( ...@@ -181,8 +181,8 @@ export async function getNotFoundError(
const formattedFileName = getFormattedFileName( const formattedFileName = getFormattedFileName(
fileName, fileName,
module, module,
lineNumber, line1,
column column1
) )
return new SimpleWebpackError(formattedFileName, message) return new SimpleWebpackError(formattedFileName, message)
......
...@@ -34,16 +34,16 @@ const frame = { ...@@ -34,16 +34,16 @@ const frame = {
file: './app/page.tsx', file: './app/page.tsx',
methodName: 'MyComponent', methodName: 'MyComponent',
arguments: [], arguments: [],
lineNumber: 10, line1: 10,
column: 5, column1: 5,
ignored: false, ignored: false,
}, },
sourceStackFrame: { sourceStackFrame: {
file: './app/page.tsx', file: './app/page.tsx',
methodName: 'MyComponent', methodName: 'MyComponent',
arguments: [], arguments: [],
lineNumber: 10, line1: 10,
column: 5, column1: 5,
}, },
error: false as const, error: false as const,
reason: null, reason: null,
......
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import type { OriginalStackFrame } from '../../../shared/stack-frame' import type { OriginalStackFrame } from '../../../shared/stack-frame'
import { HotlinkedText } from '../hot-linked-text' import { HotlinkedText } from '../hot-linked-text'
...@@ -11,14 +10,14 @@ export const CallStackFrame: React.FC<{ ...@@ -11,14 +10,14 @@ export const CallStackFrame: React.FC<{
}> = function CallStackFrame({ frame }) { }> = function CallStackFrame({ frame }) {
// TODO: ability to expand resolved frames // 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 hasSource = Boolean(frame.originalCodeFrame)
const open = useOpenInEditor( const open = useOpenInEditor(
hasSource hasSource
? { ? {
file: f.file, file: f.file,
lineNumber: f.lineNumber, line1: f.line1 ?? 1,
column: f.column, column1: f.column1 ?? 1,
} }
: undefined : undefined
) )
......
...@@ -33,16 +33,16 @@ const frame = { ...@@ -33,16 +33,16 @@ const frame = {
file: './app/page.tsx', file: './app/page.tsx',
methodName: 'MyComponent', methodName: 'MyComponent',
arguments: [], arguments: [],
lineNumber: 10, line1: 10,
column: 5, column1: 5,
ignored: false, ignored: false,
}, },
sourceStackFrame: { sourceStackFrame: {
file: './app/page.tsx', file: './app/page.tsx',
methodName: 'MyComponent', methodName: 'MyComponent',
arguments: [], arguments: [],
lineNumber: 10, line1: 10,
column: 5, column1: 5,
}, },
originalCodeFrame: 'export default function MyComponent() {', originalCodeFrame: 'export default function MyComponent() {',
error: false as const, error: false as const,
......
...@@ -17,8 +17,8 @@ const baseStackFrame = { ...@@ -17,8 +17,8 @@ const baseStackFrame = {
file: './app/page.tsx', file: './app/page.tsx',
methodName: 'Home', methodName: 'Home',
arguments: [], arguments: [],
lineNumber: 10, line1: 10,
column: 5, column1: 5,
} }
export const SimpleCodeFrame: Story = { export const SimpleCodeFrame: Story = {
......
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import { useMemo } from 'react' import { useMemo } from 'react'
import { HotlinkedText } from '../hot-linked-text' 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 { useOpenInEditor } from '../../utils/use-open-in-editor'
import { ExternalIcon } from '../../icons/external' import { ExternalIcon } from '../../icons/external'
import { FileIcon } from '../../icons/file' import { FileIcon } from '../../icons/file'
...@@ -11,7 +10,10 @@ import { ...@@ -11,7 +10,10 @@ import {
parseLineNumberFromCodeFrameLine, parseLineNumberFromCodeFrameLine,
} from './parse-code-frame' } from './parse-code-frame'
export type CodeFrameProps = { stackFrame: StackFrame; codeFrame: string } export type CodeFrameProps = {
stackFrame: StackFrame
codeFrame: string
}
export function CodeFrame({ stackFrame, codeFrame }: CodeFrameProps) { export function CodeFrame({ stackFrame, codeFrame }: CodeFrameProps) {
const parsedLineStates = useMemo(() => { const parsedLineStates = useMemo(() => {
...@@ -27,8 +29,8 @@ export function CodeFrame({ stackFrame, codeFrame }: CodeFrameProps) { ...@@ -27,8 +29,8 @@ export function CodeFrame({ stackFrame, codeFrame }: CodeFrameProps) {
const open = useOpenInEditor({ const open = useOpenInEditor({
file: stackFrame.file, file: stackFrame.file,
lineNumber: stackFrame.lineNumber, line1: stackFrame.line1 ?? 1,
column: stackFrame.column, column1: stackFrame.column1 ?? 1,
}) })
const fileExtension = stackFrame?.file?.split('.').pop() const fileExtension = stackFrame?.file?.split('.').pop()
......
...@@ -9,8 +9,8 @@ describe('parse line numbers', () => { ...@@ -9,8 +9,8 @@ describe('parse line numbers', () => {
const input = { const input = {
stackFrame: { stackFrame: {
file: 'app/page.tsx', file: 'app/page.tsx',
lineNumber: 2, line1: 2,
column: 9, column1: 9,
methodName: 'Page', methodName: 'Page',
arguments: [], arguments: [],
ignored: false, ignored: false,
...@@ -61,8 +61,8 @@ describe('parse line numbers', () => { ...@@ -61,8 +61,8 @@ describe('parse line numbers', () => {
const input = { const input = {
stackFrame: { stackFrame: {
file: 'app/page.tsx', file: 'app/page.tsx',
lineNumber: 6, line1: 6,
column: 7, column1: 7,
methodName: 'Page', methodName: 'Page',
arguments: [], arguments: [],
}, },
......
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import Anser, { type AnserJsonEntry } from 'next/dist/compiled/anser' import Anser, { type AnserJsonEntry } from 'next/dist/compiled/anser'
import stripAnsi from 'next/dist/compiled/strip-ansi' import stripAnsi from 'next/dist/compiled/strip-ansi'
import type { StackFrame } from '../../../shared/stack-frame'
// Strip leading spaces out of the code frame // Strip leading spaces out of the code frame
export function formatCodeFrame(codeFrame: string) { export function formatCodeFrame(codeFrame: string) {
...@@ -77,19 +77,19 @@ export function parseLineNumberFromCodeFrameLine( ...@@ -77,19 +77,19 @@ export function parseLineNumberFromCodeFrameLine(
stackFrame: StackFrame stackFrame: StackFrame
) { ) {
let lineNumberToken: AnserJsonEntry | undefined let lineNumberToken: AnserJsonEntry | undefined
let lineNumber: string | undefined let line1: string | undefined
// parse line number from line first 2 tokens // parse line number from line first 2 tokens
// e.g. ` > 1 | const foo = 'bar'` => `1`, first token is `1 |` // e.g. ` > 1 | const foo = 'bar'` => `1`, first token is `1 |`
// e.g. ` 2 | const foo = 'bar'` => `2`. first 2 tokens are ' ' and ' 2 |' // e.g. ` 2 | const foo = 'bar'` => `2`. first 2 tokens are ' ' and ' 2 |'
if (line[0]?.content === '>' || line[0]?.content === ' ') { if (line[0]?.content === '>' || line[0]?.content === ' ') {
lineNumberToken = line[1] 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 // 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 // e.g. the ^ sign can also take a line, we skip rendering line number for it
return { return {
lineNumber, lineNumber: line1,
isErroredLine: lineNumber === stackFrame.lineNumber?.toString(), isErroredLine: line1 === stackFrame.line1?.toString(),
} }
} }
...@@ -33,16 +33,16 @@ const frame = { ...@@ -33,16 +33,16 @@ const frame = {
file: './app/page.tsx', file: './app/page.tsx',
methodName: 'MyComponent', methodName: 'MyComponent',
arguments: [], arguments: [],
lineNumber: 10, line1: 10,
column: 5, column1: 5,
ignored: false, ignored: false,
}, },
sourceStackFrame: { sourceStackFrame: {
file: './app/page.tsx', file: './app/page.tsx',
methodName: 'MyComponent', methodName: 'MyComponent',
arguments: [], arguments: [],
lineNumber: 10, line1: 10,
column: 5, column1: 5,
}, },
originalCodeFrame: 'export default function MyComponent() {', originalCodeFrame: 'export default function MyComponent() {',
error: false as const, error: false as const,
......
...@@ -11,8 +11,8 @@ type EditorLinkProps = { ...@@ -11,8 +11,8 @@ type EditorLinkProps = {
export function EditorLink({ file, location }: EditorLinkProps) { export function EditorLink({ file, location }: EditorLinkProps) {
const open = useOpenInEditor({ const open = useOpenInEditor({
file, file,
lineNumber: location?.line ?? 1, line1: location?.line ?? 1,
column: location?.column ?? 0, column1: location?.column ?? 1,
}) })
return ( return (
......
...@@ -3,7 +3,7 @@ import * as React from 'react' ...@@ -3,7 +3,7 @@ import * as React from 'react'
import { HotlinkedText } from '../hot-linked-text' import { HotlinkedText } from '../hot-linked-text'
import { EditorLink } from './editor-link' import { EditorLink } from './editor-link'
import { ExternalIcon } from '../../icons/external' 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 { useOpenInEditor } from '../../utils/use-open-in-editor'
import { FileIcon } from '../../icons/file' import { FileIcon } from '../../icons/file'
...@@ -22,8 +22,8 @@ function getFile(lines: string[]) { ...@@ -22,8 +22,8 @@ function getFile(lines: string[]) {
fileName: hasLocation ? fileName : contentFileName, fileName: hasLocation ? fileName : contentFileName,
location: hasLocation location: hasLocation
? { ? {
line: parsedLine, line1: parsedLine,
column: parsedColumn, column1: parsedColumn,
} }
: undefined, : undefined,
} }
...@@ -74,18 +74,19 @@ export const Terminal: React.FC<TerminalProps> = function Terminal({ ...@@ -74,18 +74,19 @@ export const Terminal: React.FC<TerminalProps> = function Terminal({
}) })
}, [source]) }, [source])
console.log({ file })
const open = useOpenInEditor({ const open = useOpenInEditor({
file: file?.fileName, file: file?.fileName,
lineNumber: file?.location?.line ?? 1, line1: file?.location?.line1 ?? 1,
column: file?.location?.column ?? 0, column1: file?.location?.column1 ?? 1,
}) })
const stackFrame = { const stackFrame: StackFrame = {
file: file?.fileName ?? null, file: file?.fileName ?? null,
methodName: '', methodName: '',
arguments: [], arguments: [],
lineNumber: file?.location?.line ?? null, line1: file?.location?.line1 ?? null,
column: file?.location?.column ?? null, column1: file?.location?.column1 ?? null,
} }
const fileExtension = stackFrame?.file?.split('.').pop() const fileExtension = stackFrame?.file?.split('.').pop()
......
...@@ -98,8 +98,8 @@ export const WithHydrationWarning: Story = { ...@@ -98,8 +98,8 @@ export const WithHydrationWarning: Story = {
file: 'app/page.tsx', file: 'app/page.tsx',
methodName: 'Home', methodName: 'Home',
arguments: [], arguments: [],
lineNumber: 10, line1: 10,
column: 5, column1: 5,
}, },
}, },
]), ]),
......
import type { OverlayState } from '../../shared' import type { OverlayDispatch, OverlayState } from '../../shared'
import type { OverlayDispatch } from '../../shared' import type { StackFrame } from '../../../shared/stack-frame'
import { useMemo, useState, useEffect } from 'react' import { useMemo, useState, useEffect } from 'react'
import { import {
getErrorByType, getErrorByType,
type ReadyRuntimeError, type ReadyRuntimeError,
} from '../../utils/get-error-by-type' } from '../../utils/get-error-by-type'
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import type { ComponentStackFrame } from '../../utils/parse-component-stack' import type { ComponentStackFrame } from '../../utils/parse-component-stack'
import { usePersistentCacheErrorDetection } from '../../components/errors/error-overlay-toolbar/restart-server-button' import { usePersistentCacheErrorDetection } from '../../components/errors/error-overlay-toolbar/restart-server-button'
......
...@@ -15,16 +15,16 @@ const sourceStackFrame = { ...@@ -15,16 +15,16 @@ const sourceStackFrame = {
file: 'app/page.tsx', file: 'app/page.tsx',
methodName: 'Home', methodName: 'Home',
arguments: [], arguments: [],
lineNumber: 2, line1: 2,
column: 9, column1: 9,
} }
const originalStackFrame = { const originalStackFrame = {
file: 'app/page.tsx', file: 'app/page.tsx',
methodName: 'Home', methodName: 'Home',
arguments: [], arguments: [],
lineNumber: 2, line1: 2,
column: 9, column1: 9,
ignored: false, ignored: false,
} }
...@@ -33,16 +33,16 @@ const frame = { ...@@ -33,16 +33,16 @@ const frame = {
file: './app/page.tsx', file: './app/page.tsx',
methodName: 'MyComponent', methodName: 'MyComponent',
arguments: [], arguments: [],
lineNumber: 10, line1: 10,
column: 5, column1: 5,
ignored: false, ignored: false,
}, },
sourceStackFrame: { sourceStackFrame: {
file: './app/page.tsx', file: './app/page.tsx',
methodName: 'MyComponent', methodName: 'MyComponent',
arguments: [], arguments: [],
lineNumber: 10, line1: 10,
column: 5, column1: 5,
}, },
originalCodeFrame: 'export default function MyComponent() {', originalCodeFrame: 'export default function MyComponent() {',
error: false, error: false,
...@@ -66,8 +66,8 @@ export const errors: SupportedErrorEvent[] = [ ...@@ -66,8 +66,8 @@ export const errors: SupportedErrorEvent[] = [
{ {
file: 'app/page.tsx', file: 'app/page.tsx',
component: 'Home', component: 'Home',
lineNumber: 10, line1: 10,
column: 5, column1: 5,
canOpenInEditor: true, canOpenInEditor: true,
}, },
], ],
...@@ -76,8 +76,8 @@ export const errors: SupportedErrorEvent[] = [ ...@@ -76,8 +76,8 @@ export const errors: SupportedErrorEvent[] = [
file: 'app/page.tsx', file: 'app/page.tsx',
methodName: 'Home', methodName: 'Home',
arguments: [], arguments: [],
lineNumber: 10, line1: 10,
column: 5, column1: 5,
}, },
], ],
type: 'runtime', type: 'runtime',
......
export type ComponentStackFrame = { export type ComponentStackFrame = {
canOpenInEditor: boolean canOpenInEditor: boolean
component: string component: string
file?: string file: string | null
lineNumber?: number line1: number | null
column?: number column1: number | null
} }
enum LocationType { enum LocationType {
...@@ -42,8 +42,7 @@ function parseStackFrameLocation( ...@@ -42,8 +42,7 @@ function parseStackFrameLocation(
/^(webpack-internal:\/\/\/|file:\/\/)(\(.*\)\/)?/, /^(webpack-internal:\/\/\/|file:\/\/)(\(.*\)\/)?/,
'' ''
) )
const [, file, lineNumber, column] = const [, file, line1, column1] = modulePath?.match(/^(.+):(\d+):(\d+)/) ?? []
modulePath?.match(/^(.+):(\d+):(\d+)/) ?? []
switch (locationType) { switch (locationType) {
case LocationType.FILE: case LocationType.FILE:
...@@ -51,8 +50,8 @@ function parseStackFrameLocation( ...@@ -51,8 +50,8 @@ function parseStackFrameLocation(
return { return {
canOpenInEditor: true, canOpenInEditor: true,
file, file,
lineNumber: lineNumber ? Number(lineNumber) : undefined, line1: line1 ? Number(line1) : null,
column: column ? Number(column) : undefined, column1: column1 ? Number(column1) : null,
} }
// When the location is a URL we only show the file // When the location is a URL we only show the file
// TODO: Resolve http(s) URLs through sourcemaps // TODO: Resolve http(s) URLs through sourcemaps
...@@ -62,6 +61,9 @@ function parseStackFrameLocation( ...@@ -62,6 +61,9 @@ function parseStackFrameLocation(
default: { default: {
return { return {
canOpenInEditor: false, canOpenInEditor: false,
file: null,
line1: null,
column1: null,
} }
} }
} }
...@@ -83,6 +85,9 @@ export function parseComponentStack( ...@@ -83,6 +85,9 @@ export function parseComponentStack(
componentStackFrames.push({ componentStackFrames.push({
canOpenInEditor: false, canOpenInEditor: false,
component, component,
file: null,
line1: null,
column1: null,
}) })
continue continue
} }
......
...@@ -2,20 +2,20 @@ import { useCallback } from 'react' ...@@ -2,20 +2,20 @@ import { useCallback } from 'react'
export function useOpenInEditor({ export function useOpenInEditor({
file, file,
lineNumber, line1,
column, column1,
}: { }: {
file?: string | null file?: string | null
lineNumber?: number | null line1?: number | null
column?: number | null column1?: number | null
} = {}) { } = {}) {
const openInEditor = useCallback(() => { const openInEditor = useCallback(() => {
if (file == null || lineNumber == null || column == null) return if (file == null || line1 == null || column1 == null) return
const params = new URLSearchParams() const params = new URLSearchParams()
params.append('file', file) params.append('file', file)
params.append('lineNumber', String(lineNumber)) params.append('line1', String(line1))
params.append('column', String(column)) params.append('column1', String(column1))
self self
.fetch( .fetch(
...@@ -27,12 +27,12 @@ export function useOpenInEditor({ ...@@ -27,12 +27,12 @@ export function useOpenInEditor({
() => {}, () => {},
(cause) => { (cause) => {
console.error( 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 cause
) )
} }
) )
}, [file, lineNumber, column]) }, [file, line1, column1])
return openInEditor return openInEditor
} }
...@@ -144,8 +144,8 @@ const WINDOWS_FILE_NAME_ACCESS_LIST = ...@@ -144,8 +144,8 @@ const WINDOWS_FILE_NAME_ACCESS_LIST =
function getArgumentsForLineNumber( function getArgumentsForLineNumber(
editor: string, editor: string,
fileName: string, fileName: string,
lineNumber: number, line1: number,
colNumber: number column1: number
): string[] { ): string[] {
const editorBasename = path.basename(editor).replace(/\.(exe|cmd|bat)$/i, '') const editorBasename = path.basename(editor).replace(/\.(exe|cmd|bat)$/i, '')
switch (editorBasename) { switch (editorBasename) {
...@@ -155,30 +155,30 @@ function getArgumentsForLineNumber( ...@@ -155,30 +155,30 @@ function getArgumentsForLineNumber(
case 'subl': case 'subl':
case 'sublime': case 'sublime':
case 'sublime_text': { case 'sublime_text': {
return [fileName + ':' + lineNumber + ':' + colNumber] return [fileName + ':' + line1 + ':' + column1]
} }
case 'wstorm': case 'wstorm':
case 'charm': { case 'charm': {
return [fileName + ':' + lineNumber] return [fileName + ':' + line1]
} }
case 'notepad++': { case 'notepad++': {
return ['-n' + lineNumber, '-c' + colNumber, fileName] return ['-n' + line1, '-c' + column1, fileName]
} }
case 'vim': case 'vim':
case 'nvim': case 'nvim':
case 'mvim': case 'mvim':
case 'joe': case 'joe':
case 'gvim': { case 'gvim': {
return ['+' + lineNumber, fileName] return ['+' + line1, fileName]
} }
case 'emacs': case 'emacs':
case 'emacsclient': { case 'emacsclient': {
return ['+' + lineNumber + ':' + colNumber, fileName] return ['+' + line1 + ':' + column1, fileName]
} }
case 'rmate': case 'rmate':
case 'mate': case 'mate':
case 'mine': { case 'mine': {
return ['--line', lineNumber.toString(), fileName] return ['--line', line1.toString(), fileName]
} }
case 'code': case 'code':
case 'Code': case 'Code':
...@@ -187,7 +187,7 @@ function getArgumentsForLineNumber( ...@@ -187,7 +187,7 @@ function getArgumentsForLineNumber(
case 'Code - Insiders': case 'Code - Insiders':
case 'vscodium': case 'vscodium':
case 'VSCodium': { case 'VSCodium': {
return ['-g', fileName + ':' + lineNumber + ':' + colNumber] return ['-g', fileName + ':' + line1 + ':' + column1]
} }
case 'appcode': case 'appcode':
case 'clion': case 'clion':
...@@ -206,7 +206,7 @@ function getArgumentsForLineNumber( ...@@ -206,7 +206,7 @@ function getArgumentsForLineNumber(
case 'goland64': case 'goland64':
case 'rider': case 'rider':
case 'rider64': { case 'rider64': {
return ['--line', lineNumber.toString(), fileName] return ['--line', line1.toString(), fileName]
} }
default: { default: {
// For all others, drop the lineNumber until we have // For all others, drop the lineNumber until we have
...@@ -315,11 +315,7 @@ export function escapeApplescriptStringFragment(input: string): string { ...@@ -315,11 +315,7 @@ export function escapeApplescriptStringFragment(input: string): string {
return input.replaceAll(/[\\"]/g, (original) => `\\${original}`) return input.replaceAll(/[\\"]/g, (original) => `\\${original}`)
} }
export function launchEditor( export function launchEditor(fileName: string, line1: number, column1: number) {
fileName: string,
lineNumber: number,
colNumber: number
) {
if (!fs.existsSync(fileName)) { if (!fs.existsSync(fileName)) {
return return
} }
...@@ -327,14 +323,14 @@ export function launchEditor( ...@@ -327,14 +323,14 @@ export function launchEditor(
// Sanitize lineNumber to prevent malicious use on win32 // Sanitize lineNumber to prevent malicious use on win32
// via: https://github.com/nodejs/node/blob/c3bb4b1aa5e907d489619fb43d233c3336bfc03d/lib/child_process.js#L333 // via: https://github.com/nodejs/node/blob/c3bb4b1aa5e907d489619fb43d233c3336bfc03d/lib/child_process.js#L333
// and it should be a positive integer // and it should be a positive integer
if (!(Number.isInteger(lineNumber) && lineNumber > 0)) { if (!(Number.isInteger(line1) && line1 > 0)) {
return return
} }
// colNumber is optional, but should be a positive integer too // colNumber is optional, but should be a positive integer too
// default is 1 // default is 1
if (!(Number.isInteger(colNumber) && colNumber > 0)) { if (!(Number.isInteger(column1) && column1 > 0)) {
colNumber = 1 column1 = 1
} }
let [editor, ...args] = guessEditor() let [editor, ...args] = guessEditor()
...@@ -385,9 +381,9 @@ export function launchEditor( ...@@ -385,9 +381,9 @@ export function launchEditor(
return return
} }
if (lineNumber) { if (line1) {
args = args.concat( args = args.concat(
getArgumentsForLineNumber(editor, fileName, lineNumber, colNumber) getArgumentsForLineNumber(editor, fileName, line1, column1)
) )
} else { } else {
args.push(fileName) args.push(fileName)
...@@ -433,8 +429,8 @@ export function launchEditor( ...@@ -433,8 +429,8 @@ export function launchEditor(
// Open the file in editor if exists, otherwise return an error // Open the file in editor if exists, otherwise return an error
export async function openFileInEditor( export async function openFileInEditor(
filePath: string, filePath: string,
line: number, line1: number,
col: number column1: number
) { ) {
const result = { const result = {
found: false, found: false,
...@@ -446,7 +442,7 @@ export async function openFileInEditor( ...@@ -446,7 +442,7 @@ export async function openFileInEditor(
) )
if (existed) { if (existed) {
try { try {
launchEditor(filePath, line, col) launchEditor(filePath, line1, column1)
result.found = true result.found = true
} catch (err) { } catch (err) {
result.error = err as Error result.error = err as Error
......
import type { StackFrame } from 'stacktrace-parser'
import { codeFrameColumns } from 'next/dist/compiled/babel/code-frame' import { codeFrameColumns } from 'next/dist/compiled/babel/code-frame'
import isInternal from '../../shared/lib/is-internal' import isInternal from '../../shared/lib/is-internal'
import type { StackFrame } from '../../server/lib/parse-stack'
import { ignoreListAnonymousStackFramesIfSandwiched as ignoreListAnonymousStackFramesIfSandwichedGeneric } from '../../server/lib/source-maps' import { ignoreListAnonymousStackFramesIfSandwiched as ignoreListAnonymousStackFramesIfSandwichedGeneric } from '../../server/lib/source-maps'
export type { StackFrame }
export interface IgnorableStackFrame extends StackFrame {
ignored: boolean
}
export interface OriginalStackFramesRequest { export interface OriginalStackFramesRequest {
frames: StackFrame[] frames: StackFrame[]
isServer: boolean isServer: boolean
...@@ -58,7 +64,7 @@ export function ignoreListAnonymousStackFramesIfSandwiched( ...@@ -58,7 +64,7 @@ export function ignoreListAnonymousStackFramesIfSandwiched(
* @note It ignores Next.js/React internals, as these can often be huge bundled files. * @note It ignores Next.js/React internals, as these can often be huge bundled files.
*/ */
export function getOriginalCodeFrame( export function getOriginalCodeFrame(
frame: StackFrame, frame: IgnorableStackFrame,
source: string | null, source: string | null,
colors: boolean = process.stdout.isTTY colors: boolean = process.stdout.isTTY
): string | null { ): string | null {
...@@ -71,9 +77,9 @@ export function getOriginalCodeFrame( ...@@ -71,9 +77,9 @@ export function getOriginalCodeFrame(
{ {
start: { start: {
// 1-based, but -1 means start line without highlighting // 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 // 1-based, but 0 means whole line without column highlighting
column: frame.column ?? 0, column: frame.column1 ?? 0,
}, },
}, },
{ forceColor: colors } { forceColor: colors }
......
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import type { import type {
OriginalStackFrameResponse, OriginalStackFrameResponse,
OriginalStackFrameResponseResult, OriginalStackFrameResponseResult,
OriginalStackFramesRequest, OriginalStackFramesRequest,
StackFrame,
} from '../server/shared' } from '../server/shared'
import { import {
isWebpackInternalResource, isWebpackInternalResource,
formatFrameSourceFile, formatFrameSourceFile,
} from './webpack-module-path' } from './webpack-module-path'
export type { StackFrame }
export interface ResolvedOriginalStackFrame extends OriginalStackFrameResponse { export interface ResolvedOriginalStackFrame extends OriginalStackFrameResponse {
error: false error: false
reason: null reason: null
...@@ -157,14 +159,14 @@ export function getFrameSource(frame: StackFrame): string { ...@@ -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 // We don't need line and column numbers for anonymous sources because
// there's no entrypoint for the location anyway. // there's no entrypoint for the location anyway.
if (str && frame.file !== '<anonymous>') { if (str && frame.file !== '<anonymous>') {
if (frame.column != null) { if (frame.column1 != null) {
str += ` (${frame.lineNumber}:${frame.column})` str += ` (${frame.line1}:${frame.column1})`
} else { } else {
str += ` (${frame.lineNumber})` str += ` (${frame.line1})`
} }
} }
} }
......
import type { StackFrame } from 'stacktrace-parser'
import { getOriginalStackFrames as getOriginalStackFramesWebpack } from '../middleware-webpack' import { getOriginalStackFrames as getOriginalStackFramesWebpack } from '../middleware-webpack'
import { getOriginalStackFrames as getOriginalStackFramesTurbopack } from '../middleware-turbopack' import { getOriginalStackFrames as getOriginalStackFramesTurbopack } from '../middleware-turbopack'
import type { Project } from '../../../build/swc/types' import type { Project } from '../../../build/swc/types'
import { dim } from '../../../lib/picocolors' import { dim } from '../../../lib/picocolors'
import { parseStack } from '../../lib/parse-stack' import { parseStack, type StackFrame } from '../../lib/parse-stack'
import path from 'path' import path from 'path'
import { LRUCache } from '../../lib/lru-cache' import { LRUCache } from '../../lib/lru-cache'
...@@ -244,8 +243,8 @@ export async function getSourceMappedStackFrames( ...@@ -244,8 +243,8 @@ export async function getSourceMappedStackFrames(
function formatStackFrame(frame: StackFrame): string { function formatStackFrame(frame: StackFrame): string {
const functionName = frame.methodName || '<anonymous>' const functionName = frame.methodName || '<anonymous>'
const location = const location =
frame.file && frame.lineNumber frame.file && frame.line1
? `${frame.file}:${frame.lineNumber}${frame.column ? `:${frame.column}` : ''}` ? `${frame.file}:${frame.line1}${frame.column1 ? `:${frame.column1}` : ''}`
: frame.file || '<unknown>' : frame.file || '<unknown>'
return ` at ${functionName} (${location})` return ` at ${functionName} (${location})`
......
...@@ -2,14 +2,15 @@ import type { IncomingMessage, ServerResponse } from 'http' ...@@ -2,14 +2,15 @@ import type { IncomingMessage, ServerResponse } from 'http'
import { import {
getOriginalCodeFrame, getOriginalCodeFrame,
ignoreListAnonymousStackFramesIfSandwiched, ignoreListAnonymousStackFramesIfSandwiched,
type IgnorableStackFrame,
type OriginalStackFrameResponse, type OriginalStackFrameResponse,
type OriginalStackFramesRequest, type OriginalStackFramesRequest,
type OriginalStackFramesResponse, type OriginalStackFramesResponse,
type StackFrame,
} from '../../next-devtools/server/shared' } from '../../next-devtools/server/shared'
import { middlewareResponse } from '../../next-devtools/server/middleware-response' import { middlewareResponse } from '../../next-devtools/server/middleware-response'
import path from 'path' import path from 'path'
import { openFileInEditor } from '../../next-devtools/server/launch-editor' import { openFileInEditor } from '../../next-devtools/server/launch-editor'
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import { import {
SourceMapConsumer, SourceMapConsumer,
type NullableMappedPosition, type NullableMappedPosition,
...@@ -34,9 +35,10 @@ function shouldIgnorePath(modulePath: string): boolean { ...@@ -34,9 +35,10 @@ function shouldIgnorePath(modulePath: string): boolean {
) )
} }
type IgnorableStackFrame = StackFrame & { ignored: boolean }
const currentSourcesByFile: Map<string, Promise<string | null>> = new Map() const currentSourcesByFile: Map<string, Promise<string | null>> = new Map()
/**
* @returns 1-based lines and 1-based columns
*/
async function batchedTraceSource( async function batchedTraceSource(
project: Project, project: Project,
frame: TurbopackStackFrame frame: TurbopackStackFrame
...@@ -54,8 +56,8 @@ async function batchedTraceSource( ...@@ -54,8 +56,8 @@ async function batchedTraceSource(
return { return {
frame: { frame: {
file, file,
lineNumber: frame.line ?? 0, line1: frame.line ?? null,
column: frame.column ?? 0, column1: frame.column ?? null,
methodName: frame.methodName ?? '<unknown>', methodName: frame.methodName ?? '<unknown>',
ignored: true, ignored: true,
arguments: [], arguments: [],
...@@ -71,8 +73,8 @@ async function batchedTraceSource( ...@@ -71,8 +73,8 @@ async function batchedTraceSource(
return { return {
frame: { frame: {
file, file,
lineNumber: frame.line ?? 0, line1: frame.line ?? null,
column: frame.column ?? 0, column1: frame.column ?? null,
methodName: frame.methodName ?? '<unknown>', methodName: frame.methodName ?? '<unknown>',
ignored: shouldIgnorePath(file), ignored: shouldIgnorePath(file),
arguments: [], arguments: [],
...@@ -104,10 +106,10 @@ async function batchedTraceSource( ...@@ -104,10 +106,10 @@ async function batchedTraceSource(
} }
// TODO: get ignoredList from turbopack source map // TODO: get ignoredList from turbopack source map
const ignorableFrame = { const ignorableFrame: IgnorableStackFrame = {
file: sourceFrame.file, file: sourceFrame.file,
lineNumber: sourceFrame.line ?? 0, line1: sourceFrame.line ?? null,
column: sourceFrame.column ?? 0, column1: sourceFrame.column ?? null,
methodName: methodName:
// We ignore the sourcemapped name since it won't be the correct name. // 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 // The callsite will point to the column of the variable name instead of the
...@@ -148,10 +150,10 @@ function createStackFrames( ...@@ -148,10 +150,10 @@ function createStackFrames(
return { return {
file, file,
methodName: frame.methodName ?? '<unknown>', methodName: frame.methodName ?? '<unknown>',
line: frame.lineNumber ?? 0, line: frame.line1 ?? undefined,
column: frame.column ?? 0, column: frame.column1 ?? undefined,
isServer, isServer,
} satisfies TurbopackStackFrame }
}) })
.filter((f): f is TurbopackStackFrame => f !== undefined) .filter((f): f is TurbopackStackFrame => f !== undefined)
} }
...@@ -168,14 +170,14 @@ function createStackFrame( ...@@ -168,14 +170,14 @@ function createStackFrame(
return { return {
file, file,
methodName: searchParams.get('methodName') ?? '<unknown>', methodName: searchParams.get('methodName') ?? '<unknown>',
line: parseInt(searchParams.get('lineNumber') ?? '0', 10) || 0, line: parseInt(searchParams.get('line1') ?? '0', 10) || undefined,
column: parseInt(searchParams.get('column') ?? '0', 10) || 0, column: parseInt(searchParams.get('column1') ?? '0', 10) || undefined,
isServer: searchParams.get('isServer') === 'true', 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( async function nativeTraceSource(
frame: TurbopackStackFrame frame: TurbopackStackFrame
...@@ -230,8 +232,8 @@ async function nativeTraceSource( ...@@ -230,8 +232,8 @@ async function nativeTraceSource(
if (traced !== null) { if (traced !== null) {
const { originalPosition, sourceContent } = traced const { originalPosition, sourceContent } = traced
const applicableSourceMap = findApplicableSourceMapPayload( const applicableSourceMap = findApplicableSourceMapPayload(
frame.line ?? 0, (frame.line ?? 1) - 1,
frame.column ?? 0, (frame.column ?? 1) - 1,
sourceMapPayload sourceMapPayload
) )
...@@ -263,9 +265,10 @@ async function nativeTraceSource( ...@@ -263,9 +265,10 @@ async function nativeTraceSource(
frame.methodName frame.methodName
?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default') ?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default')
?.replace('__webpack_exports__.', '') || '<unknown>', ?.replace('__webpack_exports__.', '') || '<unknown>',
column: (originalPosition.column ?? 0) + 1,
file: originalPosition.source, 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? // TODO: c&p from async createOriginalStackFrame but why not frame.arguments?
arguments: [], arguments: [],
ignored, ignored,
...@@ -309,10 +312,10 @@ async function createOriginalStackFrame( ...@@ -309,10 +312,10 @@ async function createOriginalStackFrame(
return { return {
originalStackFrame: { originalStackFrame: {
arguments: traced.frame.arguments, arguments: traced.frame.arguments,
column: traced.frame.column,
file: normalizedStackFrameLocation, file: normalizedStackFrameLocation,
line1: traced.frame.line1,
column1: traced.frame.column1,
ignored: traced.frame.ignored, ignored: traced.frame.ignored,
lineNumber: traced.frame.lineNumber,
methodName: traced.frame.methodName, methodName: traced.frame.methodName,
}, },
originalCodeFrame: getOriginalCodeFrame(traced.frame, traced.source), originalCodeFrame: getOriginalCodeFrame(traced.frame, traced.source),
......
...@@ -2,7 +2,6 @@ import { findSourceMap, type SourceMap } from 'module' ...@@ -2,7 +2,6 @@ import { findSourceMap, type SourceMap } from 'module'
import path from 'path' import path from 'path'
import { fileURLToPath, pathToFileURL } from 'url' import { fileURLToPath, pathToFileURL } from 'url'
import { SourceMapConsumer } from 'next/dist/compiled/source-map08' 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 { getSourceMapFromFile } from './get-source-map-from-file'
import { import {
devirtualizeReactServerURL, devirtualizeReactServerURL,
...@@ -15,6 +14,8 @@ import { openFileInEditor } from '../../next-devtools/server/launch-editor' ...@@ -15,6 +14,8 @@ import { openFileInEditor } from '../../next-devtools/server/launch-editor'
import { import {
getOriginalCodeFrame, getOriginalCodeFrame,
ignoreListAnonymousStackFramesIfSandwiched, ignoreListAnonymousStackFramesIfSandwiched,
type StackFrame,
type IgnorableStackFrame,
type OriginalStackFrameResponse, type OriginalStackFrameResponse,
type OriginalStackFramesRequest, type OriginalStackFramesRequest,
type OriginalStackFramesResponse, type OriginalStackFramesResponse,
...@@ -42,10 +43,6 @@ function shouldIgnoreSource(sourceURL: string): boolean { ...@@ -42,10 +43,6 @@ function shouldIgnoreSource(sourceURL: string): boolean {
type IgnoredSources = Array<{ url: string; ignored: boolean }> type IgnoredSources = Array<{ url: string; ignored: boolean }>
export interface IgnorableStackFrame extends StackFrame {
ignored: boolean
}
type SourceAttributes = { type SourceAttributes = {
sourcePosition: NullableMappedPosition sourcePosition: NullableMappedPosition
sourceContent: string | null sourceContent: string | null
...@@ -92,7 +89,7 @@ function getSourcePath(source: string) { ...@@ -92,7 +89,7 @@ function getSourcePath(source: string) {
*/ */
async function findOriginalSourcePositionAndContent( async function findOriginalSourcePositionAndContent(
sourceMap: ModernSourceMapPayload, sourceMap: ModernSourceMapPayload,
position: { lineNumber: number | null; column: number | null } position: { line1: number | null; column1: number | null }
): Promise<SourceAttributes | null> { ): Promise<SourceAttributes | null> {
let consumer: SourceMapConsumer let consumer: SourceMapConsumer
try { try {
...@@ -109,9 +106,9 @@ async function findOriginalSourcePositionAndContent( ...@@ -109,9 +106,9 @@ async function findOriginalSourcePositionAndContent(
try { try {
const sourcePosition = consumer.originalPositionFor({ const sourcePosition = consumer.originalPositionFor({
line: position.lineNumber ?? 1, line: position.line1 ?? 1,
// 0-based columns out requires 0-based columns in. // 0-based columns out requires 0-based columns in.
column: (position.column ?? 1) - 1, column: (position.column1 ?? 1) - 1,
}) })
if (!sourcePosition.source) { if (!sourcePosition.source) {
...@@ -241,8 +238,8 @@ export async function createOriginalStackFrame({ ...@@ -241,8 +238,8 @@ export async function createOriginalStackFrame({
const traced: IgnorableStackFrame = { const traced: IgnorableStackFrame = {
file: resolvedFilePath, file: resolvedFilePath,
lineNumber: sourcePosition.line, line1: sourcePosition.line,
column: (sourcePosition.column ?? 0) + 1, column1: sourcePosition.column === null ? null : sourcePosition.column + 1,
methodName: methodName:
// We ignore the sourcemapped name since it won't be the correct name. // 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 // The callsite will point to the column of the variable name instead of the
...@@ -290,8 +287,8 @@ async function getSourceMapFromCompilation( ...@@ -290,8 +287,8 @@ async function getSourceMapFromCompilation(
async function getSource( async function getSource(
frame: { frame: {
file: string | null file: string | null
lineNumber: number | null line1: number | null
column: number | null column1: number | null
}, },
options: { options: {
getCompilations: () => webpack.Compilation[] getCompilations: () => webpack.Compilation[]
...@@ -317,8 +314,8 @@ async function getSource( ...@@ -317,8 +314,8 @@ async function getSource(
return { return {
type: 'file', type: 'file',
sourceMap: findApplicableSourceMapPayload( sourceMap: findApplicableSourceMapPayload(
frame.lineNumber ?? 0, (frame.line1 ?? 1) - 1,
frame.column ?? 0, (frame.column1 ?? 1) - 1,
sourceMapPayload sourceMapPayload
)!, )!,
...@@ -504,8 +501,8 @@ async function getOriginalStackFrame({ ...@@ -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 // This stack frame is used for the one that couldn't locate the source or source mapped frame
const defaultStackFrame: IgnorableStackFrame = { const defaultStackFrame: IgnorableStackFrame = {
file: defaultNormalizedStackFrameLocation, file: defaultNormalizedStackFrameLocation,
lineNumber: frame.lineNumber, line1: frame.line1,
column: frame.column ?? 1, column1: frame.column1,
methodName: frame.methodName, methodName: frame.methodName,
ignored: shouldIgnoreSource(filename), ignored: shouldIgnoreSource(filename),
arguments: [], arguments: [],
...@@ -578,11 +575,7 @@ export function getOverlayMiddleware(options: { ...@@ -578,11 +575,7 @@ export function getOverlayMiddleware(options: {
isServer, isServer,
isEdgeServer, isEdgeServer,
isAppDirectory, isAppDirectory,
frames: frames.map((frame) => ({ frames,
...frame,
lineNumber: frame.lineNumber ?? 0,
column: frame.column ?? 0,
})),
clientStats, clientStats,
serverStats, serverStats,
edgeServerStats, edgeServerStats,
...@@ -596,8 +589,8 @@ export function getOverlayMiddleware(options: { ...@@ -596,8 +589,8 @@ export function getOverlayMiddleware(options: {
const frame = { const frame = {
file: searchParams.get('file') as string, file: searchParams.get('file') as string,
methodName: searchParams.get('methodName') as string, methodName: searchParams.get('methodName') as string,
lineNumber: parseInt(searchParams.get('lineNumber') ?? '0', 10) || 0, line1: parseInt(searchParams.get('line1') ?? '1', 10) || 1,
column: parseInt(searchParams.get('column') ?? '0', 10) || 0, column1: parseInt(searchParams.get('column1') ?? '1', 10) || 1,
arguments: searchParams.getAll('arguments').filter(Boolean), arguments: searchParams.getAll('arguments').filter(Boolean),
} satisfies StackFrame } satisfies StackFrame
...@@ -622,8 +615,8 @@ export function getOverlayMiddleware(options: { ...@@ -622,8 +615,8 @@ export function getOverlayMiddleware(options: {
) )
openEditorResult = await openFileInEditor( openEditorResult = await openFileInEditor(
filePath, filePath,
frame.lineNumber, frame.line1,
frame.column ?? 1 frame.column1 ?? 1
) )
} }
if (openEditorResult.error) { if (openEditorResult.error) {
...@@ -674,8 +667,8 @@ export function getSourceMapMiddleware(options: { ...@@ -674,8 +667,8 @@ export function getSourceMapMiddleware(options: {
{ {
file: filename, file: filename,
// Webpack doesn't use Index Source Maps // Webpack doesn't use Index Source Maps
lineNumber: null, line1: null,
column: null, column1: null,
}, },
{ {
getCompilations: () => { getCompilations: () => {
......
import { parse } from 'next/dist/compiled/stacktrace-parser' import { parse } from 'next/dist/compiled/stacktrace-parser'
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
const regexNextStatic = /\/_next(\/static\/.+)/ 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( export function parseStack(
stack: string, stack: string,
distDir = process.env.__NEXT_DIST_DIR distDir = process.env.__NEXT_DIST_DIR
...@@ -40,6 +49,12 @@ export function parseStack( ...@@ -40,6 +49,12 @@ export function parseStack(
} }
} }
} catch {} } catch {}
return frame return {
file: frame.file,
line1: frame.lineNumber,
column1: frame.column,
methodName: frame.methodName,
arguments: frame.arguments,
}
}) })
} }
...@@ -58,6 +58,8 @@ export function sourceMapIgnoreListsEverything( ...@@ -58,6 +58,8 @@ export function sourceMapIgnoreListsEverything(
/** /**
* Finds the sourcemap payload applicable to a given frame. * Finds the sourcemap payload applicable to a given frame.
* Equal to the input unless an Index Source Map is used. * 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( export function findApplicableSourceMapPayload(
line0: number, line0: number,
......
...@@ -3,14 +3,13 @@ import * as path from 'path' ...@@ -3,14 +3,13 @@ import * as path from 'path'
import * as url from 'url' import * as url from 'url'
import type * as util from 'util' import type * as util from 'util'
import { SourceMapConsumer as SyncSourceMapConsumer } from 'next/dist/compiled/source-map' import { SourceMapConsumer as SyncSourceMapConsumer } from 'next/dist/compiled/source-map'
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import { import {
type ModernSourceMapPayload, type ModernSourceMapPayload,
findApplicableSourceMapPayload, findApplicableSourceMapPayload,
ignoreListAnonymousStackFramesIfSandwiched as ignoreListAnonymousStackFramesIfSandwichedGeneric, ignoreListAnonymousStackFramesIfSandwiched as ignoreListAnonymousStackFramesIfSandwichedGeneric,
sourceMapIgnoreListsEverything, sourceMapIgnoreListsEverything,
} from './lib/source-maps' } 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 { getOriginalCodeFrame } from '../next-devtools/server/shared'
import { workUnitAsyncStorage } from './app-render/work-unit-async-storage.external' import { workUnitAsyncStorage } from './app-render/work-unit-async-storage.external'
import { dim } from '../lib/picocolors' import { dim } from '../lib/picocolors'
...@@ -30,7 +29,7 @@ export function setBundlerFindSourceMapImplementation( ...@@ -30,7 +29,7 @@ export function setBundlerFindSourceMapImplementation(
bundlerFindSourceMapPayload = findSourceMapImplementation bundlerFindSourceMapPayload = findSourceMapImplementation
} }
interface IgnoreableStackFrame extends StackFrame { interface IgnorableStackFrame extends StackFrame {
ignored: boolean ignored: boolean
} }
...@@ -39,31 +38,36 @@ type SourceMapCache = Map< ...@@ -39,31 +38,36 @@ type SourceMapCache = Map<
null | { map: SyncSourceMapConsumer; payload: ModernSourceMapPayload } null | { map: SyncSourceMapConsumer; payload: ModernSourceMapPayload }
> >
function frameToString(frame: StackFrame): string { function frameToString(
let sourceLocation = frame.lineNumber !== null ? `:${frame.lineNumber}` : '' methodName: string | null,
if (frame.column !== null && sourceLocation !== '') { sourceURL: string | null,
sourceLocation += `:${frame.column}` line1: number | null,
column1: number | null
): string {
let sourceLocation = line1 !== null ? `:${line1}` : ''
if (column1 !== null && sourceLocation !== '') {
sourceLocation += `:${column1}`
} }
let fileLocation: string | null let fileLocation: string | null
if ( if (
frame.file !== null && sourceURL !== null &&
frame.file.startsWith('file://') && sourceURL.startsWith('file://') &&
URL.canParse(frame.file) URL.canParse(sourceURL)
) { ) {
// If not relative to CWD, the path is ambiguous to IDEs and clicking will prompt to select the file first. // 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. // 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 // 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. // since relative to cwd is both the shortest and snappiest.
fileLocation = path.relative(process.cwd(), url.fileURLToPath(frame.file)) fileLocation = path.relative(process.cwd(), url.fileURLToPath(sourceURL))
} else if (frame.file !== null && frame.file.startsWith('/')) { } else if (sourceURL !== null && sourceURL.startsWith('/')) {
fileLocation = path.relative(process.cwd(), frame.file) fileLocation = path.relative(process.cwd(), sourceURL)
} else { } else {
fileLocation = frame.file fileLocation = sourceURL
} }
return frame.methodName return methodName
? ` at ${frame.methodName} (${fileLocation}${sourceLocation})` ? ` at ${methodName} (${fileLocation}${sourceLocation})`
: ` at ${fileLocation}${sourceLocation}` : ` at ${fileLocation}${sourceLocation}`
} }
...@@ -100,7 +104,7 @@ interface SourcemappableStackFrame extends StackFrame { ...@@ -100,7 +104,7 @@ interface SourcemappableStackFrame extends StackFrame {
} }
interface SourceMappedFrame { interface SourceMappedFrame {
stack: IgnoreableStackFrame stack: IgnorableStackFrame
// DEV only // DEV only
code: string | null code: string | null
} }
...@@ -110,11 +114,11 @@ function createUnsourcemappedFrame( ...@@ -110,11 +114,11 @@ function createUnsourcemappedFrame(
): SourceMappedFrame { ): SourceMappedFrame {
return { return {
stack: { stack: {
arguments: frame.arguments,
column: frame.column,
file: frame.file, file: frame.file,
lineNumber: frame.lineNumber, line1: frame.line1,
column1: frame.column1,
methodName: frame.methodName, methodName: frame.methodName,
arguments: frame.arguments,
ignored: shouldIgnoreListGeneratedFrame(frame.file), ignored: shouldIgnoreListGeneratedFrame(frame.file),
}, },
code: null, code: null,
...@@ -123,7 +127,7 @@ function createUnsourcemappedFrame( ...@@ -123,7 +127,7 @@ function createUnsourcemappedFrame(
function ignoreListAnonymousStackFramesIfSandwiched( function ignoreListAnonymousStackFramesIfSandwiched(
sourceMappedFrames: Array<{ sourceMappedFrames: Array<{
stack: IgnoreableStackFrame stack: IgnorableStackFrame
code: string | null code: string | null
}> }>
) { ) {
...@@ -148,7 +152,7 @@ function getSourcemappedFrameIfPossible( ...@@ -148,7 +152,7 @@ function getSourcemappedFrameIfPossible(
sourceMapCache: SourceMapCache, sourceMapCache: SourceMapCache,
inspectOptions: util.InspectOptions inspectOptions: util.InspectOptions
): { ): {
stack: IgnoreableStackFrame stack: IgnorableStackFrame
code: string | null code: string | null
} { } {
const sourceMapCacheEntry = sourceMapCache.get(frame.file) const sourceMapCacheEntry = sourceMapCache.get(frame.file)
...@@ -222,13 +226,13 @@ function getSourcemappedFrameIfPossible( ...@@ -222,13 +226,13 @@ function getSourcemappedFrameIfPossible(
} }
const sourcePosition = sourceMapConsumer.originalPositionFor({ const sourcePosition = sourceMapConsumer.originalPositionFor({
column: frame.column ?? 0, column: (frame.column1 ?? 1) - 1,
line: frame.lineNumber ?? 1, line: frame.line1 ?? 1,
}) })
const applicableSourceMap = findApplicableSourceMapPayload( const applicableSourceMap = findApplicableSourceMapPayload(
frame.lineNumber ?? 0, (frame.line1 ?? 1) - 1,
frame.column ?? 0, (frame.column1 ?? 1) - 1,
sourceMapPayload sourceMapPayload
) )
let ignored = let ignored =
...@@ -238,9 +242,9 @@ function getSourcemappedFrameIfPossible( ...@@ -238,9 +242,9 @@ function getSourcemappedFrameIfPossible(
return { return {
stack: { stack: {
arguments: frame.arguments, arguments: frame.arguments,
column: frame.column,
file: frame.file, file: frame.file,
lineNumber: frame.lineNumber, line1: frame.line1,
column1: frame.column1,
methodName: frame.methodName, methodName: frame.methodName,
ignored: ignored || shouldIgnoreListGeneratedFrame(frame.file), ignored: ignored || shouldIgnoreListGeneratedFrame(frame.file),
}, },
...@@ -267,7 +271,7 @@ function getSourcemappedFrameIfPossible( ...@@ -267,7 +271,7 @@ function getSourcemappedFrameIfPossible(
ignored = applicableSourceMap.ignoreList?.includes(sourceIndex) ?? false 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. // 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 // The callsite will point to the column of the variable name instead of the
// name of the enclosing function. // name of the enclosing function.
...@@ -275,9 +279,9 @@ function getSourcemappedFrameIfPossible( ...@@ -275,9 +279,9 @@ function getSourcemappedFrameIfPossible(
methodName: frame.methodName methodName: frame.methodName
?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default') ?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default')
?.replace('__webpack_exports__.', ''), ?.replace('__webpack_exports__.', ''),
column: sourcePosition.column,
file: sourcePosition.source, file: sourcePosition.source,
lineNumber: sourcePosition.line, line1: sourcePosition.line,
column1: sourcePosition.column + 1,
// TODO: c&p from async createOriginalStackFrame but why not frame.arguments? // TODO: c&p from async createOriginalStackFrame but why not frame.arguments?
arguments: [], arguments: [],
ignored, ignored,
...@@ -343,7 +347,7 @@ function parseAndSourceMap( ...@@ -343,7 +347,7 @@ function parseAndSourceMap(
const sourceMapCache: SourceMapCache = new Map() const sourceMapCache: SourceMapCache = new Map()
const sourceMappedFrames: Array<{ const sourceMappedFrames: Array<{
stack: IgnoreableStackFrame stack: IgnorableStackFrame
code: string | null code: string | null
}> = [] }> = []
let sourceFrame: null | string = null let sourceFrame: null | string = null
...@@ -352,11 +356,11 @@ function parseAndSourceMap( ...@@ -352,11 +356,11 @@ function parseAndSourceMap(
sourceMappedFrames.push({ sourceMappedFrames.push({
code: null, code: null,
stack: { stack: {
arguments: frame.arguments,
column: frame.column,
file: frame.file, file: frame.file,
lineNumber: frame.lineNumber, line1: frame.line1,
column1: frame.column1,
methodName: frame.methodName, methodName: frame.methodName,
arguments: frame.arguments,
ignored: false, ignored: false,
}, },
}) })
...@@ -390,9 +394,25 @@ function parseAndSourceMap( ...@@ -390,9 +394,25 @@ function parseAndSourceMap(
const frame = sourceMappedFrames[i] const frame = sourceMappedFrames[i]
if (!frame.stack.ignored) { 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) { } 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
)
)
} }
} }
......
...@@ -1159,41 +1159,25 @@ describe('ReactRefreshLogBox app', () => { ...@@ -1159,41 +1159,25 @@ describe('ReactRefreshLogBox app', () => {
) )
const { browser } = sandbox const { browser } = sandbox
if (isTurbopack) { // TODO(veil): Turbopack uses correct name
// TODO(veil): investigate the column number is off by 1 between turbo and webpack // TODO(veil): Column of 2nd frame should be 7
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "This is an error from an anonymous function", "description": "This is an error from an anonymous function",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Runtime Error", "label": "Runtime Error",
"source": "app/page.js (4:13) @ <anonymous> "source": "app/page.js (4:13) @ ${isTurbopack ? '<anonymous>' : 'eval'}
> 4 | throw new Error("This is an error from an anonymous function"); > 4 | throw new Error("This is an error from an anonymous function");
| ^", | ^",
"stack": [ "stack": [
"<anonymous> app/page.js (4:13)", "${isTurbopack ? '<anonymous>' : 'eval'} app/page.js (4:13)",
"Page app/page.js (5:6)", "Page app/page.js (5:${isTurbopack ? '6' : '5'})",
], ],
} }
`) `)
} 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)",
],
}
`)
}
}) })
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( await using sandbox = await createSandbox(
next, next,
new Map([ new Map([
...@@ -1209,7 +1193,6 @@ describe('ReactRefreshLogBox app', () => { ...@@ -1209,7 +1193,6 @@ describe('ReactRefreshLogBox app', () => {
) )
const { browser } = sandbox const { browser } = sandbox
if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "Invalid URL", "description": "Invalid URL",
...@@ -1223,21 +1206,6 @@ describe('ReactRefreshLogBox app', () => { ...@@ -1223,21 +1206,6 @@ describe('ReactRefreshLogBox app', () => {
], ],
} }
`) `)
} 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)",
],
}
`)
}
}) })
test('Server component errors should open up in fullscreen', async () => { test('Server component errors should open up in fullscreen', async () => {
......
...@@ -3,7 +3,7 @@ import { outdent } from 'outdent' ...@@ -3,7 +3,7 @@ import { outdent } from 'outdent'
import { FileRef, nextTestSetup } from 'e2e-utils' import { FileRef, nextTestSetup } from 'e2e-utils'
describe('Error overlay - RSC runtime errors', () => { describe('Error overlay - RSC runtime errors', () => {
const { isTurbopack, next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'rsc-runtime-errors')), files: new FileRef(path.join(__dirname, 'fixtures', 'rsc-runtime-errors')),
}) })
...@@ -51,22 +51,6 @@ describe('Error overlay - RSC runtime errors', () => { ...@@ -51,22 +51,6 @@ describe('Error overlay - RSC runtime errors', () => {
const browser = await next.browser('/client') 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(` await expect(browser).toDisplayRedbox(`
{ {
"description": "\`cookies\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context", "description": "\`cookies\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context",
...@@ -80,7 +64,6 @@ describe('Error overlay - RSC runtime errors', () => { ...@@ -80,7 +64,6 @@ describe('Error overlay - RSC runtime errors', () => {
], ],
} }
`) `)
}
}) })
it('should show source code for jsx errors from server component', async () => { it('should show source code for jsx errors from server component', async () => {
......
...@@ -96,7 +96,7 @@ describe('Dynamic IO Dev Errors', () => { ...@@ -96,7 +96,7 @@ describe('Dynamic IO Dev Errors', () => {
`\nError: Route "/no-accessed-data": ` + `\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. ` + `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` + `See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense` +
'\n at Page (<FIXME-file-protocol>/app/no-accessed-data/page.js:1:30)' + '\n at Page (<FIXME-file-protocol>/app/no-accessed-data/page.js:1:31)' +
'\n> 1 | export default async function Page() {' + '\n> 1 | export default async function Page() {' +
'\n | ^' + '\n | ^' +
'\n 2 | await new Promise((r) => setTimeout(r, 200))' + '\n 2 | await new Promise((r) => setTimeout(r, 200))' +
...@@ -108,7 +108,7 @@ describe('Dynamic IO Dev Errors', () => { ...@@ -108,7 +108,7 @@ describe('Dynamic IO Dev Errors', () => {
`\nError: Route "/no-accessed-data": ` + `\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. ` + `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` + `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> 1 | export default async function Page() {' +
'\n | ^' + '\n | ^' +
'\n 2 | await new Promise((r) => setTimeout(r, 200))' + '\n 2 | await new Promise((r) => setTimeout(r, 200))' +
......
...@@ -54,7 +54,7 @@ describe('error-ignored-frames', () => { ...@@ -54,7 +54,7 @@ describe('error-ignored-frames', () => {
if (isTurbopack) { if (isTurbopack) {
expect(defaultStack).toMatchInlineSnapshot(` expect(defaultStack).toMatchInlineSnapshot(`
"at <unknown> (app/interleaved/page.tsx (7:11)) "at <unknown> (app/interleaved/page.tsx (7:11))
at Page (app/interleaved/page.tsx (6:35))" at Page (app/interleaved/page.tsx (6:36))"
`) `)
} else { } else {
expect(defaultStack).toMatchInlineSnapshot(` expect(defaultStack).toMatchInlineSnapshot(`
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
describe('server-navigation-error', () => { describe('server-navigation-error', () => {
const { isTurbopack, next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
...@@ -9,7 +9,6 @@ describe('server-navigation-error', () => { ...@@ -9,7 +9,6 @@ describe('server-navigation-error', () => {
it('should error on navigation API redirect', async () => { it('should error on navigation API redirect', async () => {
const browser = await next.browser('/pages/redirect') const browser = await next.browser('/pages/redirect')
if (isTurbopack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": "Next.js navigation API is not allowed to be used in Pages Router.", "description": "Next.js navigation API is not allowed to be used in Pages Router.",
...@@ -23,41 +22,11 @@ describe('server-navigation-error', () => { ...@@ -23,41 +22,11 @@ describe('server-navigation-error', () => {
], ],
} }
`) `)
} 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)",
],
}
`)
}
}) })
it('should error on navigation API notFound', async () => { it('should error on navigation API notFound', async () => {
const browser = await next.browser('/pages/not-found') 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(` await expect(browser).toDisplayRedbox(`
{ {
"description": "Next.js navigation API is not allowed to be used in Pages Router.", "description": "Next.js navigation API is not allowed to be used in Pages Router.",
...@@ -71,7 +40,6 @@ describe('server-navigation-error', () => { ...@@ -71,7 +40,6 @@ describe('server-navigation-error', () => {
], ],
} }
`) `)
}
}) })
}) })
...@@ -81,22 +49,6 @@ describe('server-navigation-error', () => { ...@@ -81,22 +49,6 @@ describe('server-navigation-error', () => {
// FIXME: the first request to middleware error load didn't show the redbox, need one more reload // FIXME: the first request to middleware error load didn't show the redbox, need one more reload
await browser.refresh() 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(` await expect(browser).toDisplayRedbox(`
{ {
"description": "Next.js navigation API is not allowed to be used in Middleware.", "description": "Next.js navigation API is not allowed to be used in Middleware.",
...@@ -110,28 +62,11 @@ describe('server-navigation-error', () => { ...@@ -110,28 +62,11 @@ describe('server-navigation-error', () => {
], ],
} }
`) `)
}
}) })
it('should error on navigation API not-found', async () => { it('should error on navigation API not-found', async () => {
const browser = await next.browser('/middleware/not-found') 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(` await expect(browser).toDisplayRedbox(`
{ {
"description": "Next.js navigation API is not allowed to be used in Middleware.", "description": "Next.js navigation API is not allowed to be used in Middleware.",
...@@ -145,7 +80,6 @@ describe('server-navigation-error', () => { ...@@ -145,7 +80,6 @@ describe('server-navigation-error', () => {
], ],
} }
`) `)
}
}) })
}) })
}) })
...@@ -2,7 +2,7 @@ import { nextTestSetup } from 'e2e-utils' ...@@ -2,7 +2,7 @@ import { nextTestSetup } from 'e2e-utils'
import { assertNoRedbox } from '../../../lib/next-test-utils' import { assertNoRedbox } from '../../../lib/next-test-utils'
describe('use-cache-errors', () => { describe('use-cache-errors', () => {
const { isTurbopack, next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
const isRspack = Boolean(process.env.NEXT_RSPACK) const isRspack = Boolean(process.env.NEXT_RSPACK)
...@@ -18,25 +18,7 @@ describe('use-cache-errors', () => { ...@@ -18,25 +18,7 @@ describe('use-cache-errors', () => {
it('should show a runtime error when calling the incorrectly used cache function', async () => { it('should show a runtime error when calling the incorrectly used cache function', async () => {
const browser = await next.browser('/') const browser = await next.browser('/')
await browser.elementById('action-button').click() await browser.elementById('action-button').click()
if (isRspack) {
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": [
"<FIXME-file-protocol>",
"useCachedStuff app/module-with-use-cache.ts (16:17)",
"Page app/page.tsx (22:10)",
],
}
`)
} else if (isRspack) {
// TODO: the source is missing and the stack leaks rspack internals // TODO: the source is missing and the stack leaks rspack internals
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
......
...@@ -35,10 +35,10 @@ describe('middleware - development errors', () => { ...@@ -35,10 +35,10 @@ describe('middleware - development errors', () => {
isTurbopack isTurbopack
? '\n ⨯ Error: boom' + ? '\n ⨯ Error: boom' +
// TODO(veil): Sourcemap to original name i.e. "default" // 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 1 |'
: '\n ⨯ Error: boom' + : '\n ⨯ Error: boom' +
'\n at default (middleware.js:3:14)' + '\n at default (middleware.js:3:15)' +
'\n 1 |' '\n 1 |'
) )
expect(stripAnsi(next.cliOutput)).toContain( expect(stripAnsi(next.cliOutput)).toContain(
...@@ -117,13 +117,13 @@ describe('middleware - development errors', () => { ...@@ -117,13 +117,13 @@ describe('middleware - development errors', () => {
expect(stripAnsi(next.cliOutput)).toContain( expect(stripAnsi(next.cliOutput)).toContain(
isTurbopack isTurbopack
? ' ⨯ unhandledRejection: Error: async boom!' + ? ' ⨯ 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" // 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 2 | import { NextResponse } from 'next/server'"
: '\n ⨯ unhandledRejection: Error: async boom!' + : '\n ⨯ unhandledRejection: Error: async boom!' +
'\n at throwError (middleware.js:4:14)' + '\n at throwError (middleware.js:4:15)' +
'\n at default (middleware.js:7:8)' + '\n at default (middleware.js:7:9)' +
"\n 2 | import { NextResponse } from 'next/server'" "\n 2 | import { NextResponse } from 'next/server'"
) )
expect(stripAnsi(next.cliOutput)).toContain( expect(stripAnsi(next.cliOutput)).toContain(
...@@ -172,15 +172,15 @@ describe('middleware - development errors', () => { ...@@ -172,15 +172,15 @@ describe('middleware - development errors', () => {
expect(stripAnsi(next.cliOutput)).toContain( expect(stripAnsi(next.cliOutput)).toContain(
isTurbopack isTurbopack
? '\n ⨯ Error [ReferenceError]: test is not defined' + ? '\n ⨯ Error [ReferenceError]: test is not defined' +
'\n at eval (middleware.js:4:8)' + '\n at eval (middleware.js:4:9)' +
'\n at <unknown> (middleware.js:4:8)' + '\n at <unknown> (middleware.js:4:9)' +
// TODO(veil): Should be sourcemapped // TODO(veil): Should be sourcemapped
'\n at __TURBOPACK__default__export__ (' '\n at __TURBOPACK__default__export__ ('
: '\n ⨯ Error [ReferenceError]: test is not defined' + : '\n ⨯ Error [ReferenceError]: test is not defined' +
// TODO(veil): Redundant and not clickable // TODO(veil): Redundant and not clickable
'\n at eval (file://webpack-internal:///(middleware)/./middleware.js)' + '\n at eval (file://webpack-internal:///(middleware)/./middleware.js)' +
'\n at eval (middleware.js:4:8)' + '\n at eval (middleware.js:4:9)' +
'\n at default (middleware.js:4:8)' + '\n at default (middleware.js:4:9)' +
"\n 2 | import { NextResponse } from 'next/server'" "\n 2 | import { NextResponse } from 'next/server'"
) )
expect(stripAnsi(next.cliOutput)).toContain( expect(stripAnsi(next.cliOutput)).toContain(
...@@ -191,7 +191,7 @@ describe('middleware - development errors', () => { ...@@ -191,7 +191,7 @@ describe('middleware - development errors', () => {
'\n at __TURBOPACK__default__export__ (' '\n at __TURBOPACK__default__export__ ('
: "\n ⚠ DynamicCodeEvaluationWarning: Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime" + : "\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' + '\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'" "\n 2 | import { NextResponse } from 'next/server'"
) )
}) })
...@@ -273,7 +273,7 @@ describe('middleware - development errors', () => { ...@@ -273,7 +273,7 @@ describe('middleware - development errors', () => {
// TODO: Should be anonymous method without a method name // TODO: Should be anonymous method without a method name
'\n at <unknown> (middleware.js:3)' + '\n at <unknown> (middleware.js:3)' +
// TODO: Should be ignore-listed // 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 (middleware)/./middleware.js (.next/server/middleware.js:18:1)' +
'\n at __webpack_require__ ' '\n at __webpack_require__ '
) )
...@@ -306,7 +306,7 @@ describe('middleware - development errors', () => { ...@@ -306,7 +306,7 @@ describe('middleware - development errors', () => {
> 3 | throw new Error('booooom!') > 3 | throw new Error('booooom!')
| ^", | ^",
"stack": [ "stack": [
"<unknown> middleware.js (3:0)", "<unknown> middleware.js (3)",
"eval middleware.js (3:13)", "eval middleware.js (3:13)",
"<FIXME-next-dist-dir>", "<FIXME-next-dist-dir>",
"<FIXME-next-dist-dir>", "<FIXME-next-dist-dir>",
......
...@@ -33,7 +33,7 @@ describe('dynamic-io', () => { ...@@ -33,7 +33,7 @@ describe('dynamic-io', () => {
/console: This is a console page /console: This is a console page
/console: not a template { foo: 'just-some-object' } /console: not a template { foo: 'just-some-object' }
Error: /console: test 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')   3 | console.log('/console: This is a console page')
 4 | console.warn('/console: not a template', { foo: 'just-some-object' })  4 | console.warn('/console: not a template', { foo: 'just-some-object' })
> 5 | console.error(new Error('/console: test')) > 5 | console.error(new Error('/console: test'))
...@@ -46,7 +46,7 @@ describe('dynamic-io', () => { ...@@ -46,7 +46,7 @@ describe('dynamic-io', () => {
/console: This is a console page /console: This is a console page
/console: not a template { foo: 'just-some-object' } /console: not a template { foo: 'just-some-object' }
Error: /console: test 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') 3 | console.log('/console: This is a console page')
4 | console.warn('/console: not a template', { foo: 'just-some-object' }) 4 | console.warn('/console: not a template', { foo: 'just-some-object' })
> 5 | console.error(new Error('/console: test')) > 5 | console.error(new Error('/console: test'))
...@@ -59,7 +59,7 @@ describe('dynamic-io', () => { ...@@ -59,7 +59,7 @@ describe('dynamic-io', () => {
/console: This is a console page /console: This is a console page
/console: not a template { foo: 'just-some-object' } /console: not a template { foo: 'just-some-object' }
Error: /console: test 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') 3 | console.log('/console: This is a console page')
4 | console.warn('/console: not a template', { foo: 'just-some-object' }) 4 | console.warn('/console: not a template', { foo: 'just-some-object' })
> 5 | console.error(new Error('/console: test')) > 5 | console.error(new Error('/console: test'))
......
...@@ -30,8 +30,8 @@ describe('app-dir - server source maps edge runtime', () => { ...@@ -30,8 +30,8 @@ describe('app-dir - server source maps edge runtime', () => {
}) })
expect(normalizeCliOutput(next.cliOutput.slice(outputIndex))).toContain( expect(normalizeCliOutput(next.cliOutput.slice(outputIndex))).toContain(
'\nError: rsc-error-log' + '\nError: rsc-error-log' +
'\n at logError (app/rsc-error-log/page.js:2:16)' + '\n at logError (app/rsc-error-log/page.js:2:17)' +
'\n at Page (app/rsc-error-log/page.js:6:2)' + '\n at Page (app/rsc-error-log/page.js:6:3)' +
'\n 1 | function logError() {' + '\n 1 | function logError() {' +
"\n> 2 | console.error(new Error('rsc-error-log'))" + "\n> 2 | console.error(new Error('rsc-error-log'))" +
'\n | ^' + '\n | ^' +
...@@ -59,8 +59,8 @@ describe('app-dir - server source maps edge runtime', () => { ...@@ -59,8 +59,8 @@ describe('app-dir - server source maps edge runtime', () => {
const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex)) const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex))
expect(cliOutput).toContain( expect(cliOutput).toContain(
'\n ⨯ Error: ssr-throw' + '\n ⨯ Error: ssr-throw' +
'\n at throwError (app/ssr-throw/page.js:4:8)' + '\n at throwError (app/ssr-throw/page.js:4:9)' +
'\n at Page (app/ssr-throw/page.js:8:2)' + '\n at Page (app/ssr-throw/page.js:8:3)' +
'\n 2 |' + '\n 2 |' +
'\n 3 | function throwError() {' + '\n 3 | function throwError() {' +
"\n> 4 | throw new Error('ssr-throw')" + "\n> 4 | throw new Error('ssr-throw')" +
...@@ -89,8 +89,8 @@ describe('app-dir - server source maps edge runtime', () => { ...@@ -89,8 +89,8 @@ describe('app-dir - server source maps edge runtime', () => {
const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex)) const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex))
expect(cliOutput).toContain( expect(cliOutput).toContain(
'\n ⨯ Error: rsc-throw' + '\n ⨯ Error: rsc-throw' +
'\n at throwError (app/rsc-throw/page.js:2:8)' + '\n at throwError (app/rsc-throw/page.js:2:9)' +
'\n at Page (app/rsc-throw/page.js:6:2)' + '\n at Page (app/rsc-throw/page.js:6:3)' +
'\n 1 | function throwError() {' + '\n 1 | function throwError() {' +
"\n> 2 | throw new Error('rsc-throw')" + "\n> 2 | throw new Error('rsc-throw')" +
'\n | ^' + '\n | ^' +
......
...@@ -48,25 +48,12 @@ describe('use-cache-close-over-function', () => { ...@@ -48,25 +48,12 @@ describe('use-cache-close-over-function', () => {
const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex)) const cliOutput = stripAnsi(next.cliOutput.slice(outputIndex))
expect(cliOutput).toContain( 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.' + '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 [function fn]' +
'\n ^^^^^^^^^^^' + '\n ^^^^^^^^^^^' +
'\n at createCachedFn (app/client/page.tsx:8:2)' + '\n at createCachedFn (app/client/page.tsx:8:3)' +
'\n at Page (app/client/page.tsx:15:27)' + '\n at Page (app/client/page.tsx:15:28)' +
'\n 6 | }' + '\n 6 | }' +
'\n 7 |' + '\n 7 |' +
'\n> 8 | return async () => {' + '\n> 8 | return async () => {' +
...@@ -111,15 +98,15 @@ describe('use-cache-close-over-function', () => { ...@@ -111,15 +98,15 @@ 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.' + '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 [function fn]' +
'\n ^^^^^^^^^^^' + '\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. // TODO(veil): Should be source-mapped.
'\n at [project]' '\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.' + '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 [function fn]' +
'\n ^^^^^^^^^^^' + '\n ^^^^^^^^^^^' +
'\n at createCachedFn (app/server/page.tsx:6:2)' + '\n at createCachedFn (app/server/page.tsx:6:3)' +
'\n at eval (app/server/page.tsx:12:23)' + '\n at eval (app/server/page.tsx:12:24)' +
// TODO(veil): Should be source-mapped. // TODO(veil): Should be source-mapped.
'\n at <unknown> (rsc)' '\n at <unknown> (rsc)'
) )
......
...@@ -74,7 +74,7 @@ describe('use-cache-hanging-inputs', () => { ...@@ -74,7 +74,7 @@ describe('use-cache-hanging-inputs', () => {
`) `)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} 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) }, 180_000)
}) })
...@@ -124,7 +124,7 @@ describe('use-cache-hanging-inputs', () => { ...@@ -124,7 +124,7 @@ describe('use-cache-hanging-inputs', () => {
`) `)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} 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) }, 180_000)
}) })
...@@ -191,7 +191,7 @@ describe('use-cache-hanging-inputs', () => { ...@@ -191,7 +191,7 @@ describe('use-cache-hanging-inputs', () => {
`) `)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} 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) }, 180_000)
}) })
...@@ -245,7 +245,7 @@ describe('use-cache-hanging-inputs', () => { ...@@ -245,7 +245,7 @@ describe('use-cache-hanging-inputs', () => {
`) `)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} 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) }, 180_000)
}) })
...@@ -300,7 +300,7 @@ describe('use-cache-hanging-inputs', () => { ...@@ -300,7 +300,7 @@ describe('use-cache-hanging-inputs', () => {
`) `)
expect(cliOutput).toContain(`Error: ${expectedTimeoutErrorMessage} 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) }, 180_000)
}) })
......
...@@ -92,7 +92,7 @@ describe('use-cache-standalone-search-params', () => { ...@@ -92,7 +92,7 @@ describe('use-cache-standalone-search-params', () => {
`) `)
expect(cliOutput).toContain(`Error: ${expectedErrorMessage} 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 () => { it('should also show an error after the second reload', async () => {
......
...@@ -4,7 +4,7 @@ import { check } from 'next-test-utils' ...@@ -4,7 +4,7 @@ import { check } from 'next-test-utils'
import stripAnsi from 'strip-ansi' import stripAnsi from 'strip-ansi'
describe('fetch failures have good stack traces in edge runtime', () => { 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, files: __dirname,
// don't have access to runtime logs on deploy // don't have access to runtime logs on deploy
skipDeployment: true, skipDeployment: true,
...@@ -31,8 +31,8 @@ describe('fetch failures have good stack traces in edge runtime', () => { ...@@ -31,8 +31,8 @@ describe('fetch failures have good stack traces in edge runtime', () => {
expect(stripAnsi(next.cliOutput.slice(outputIndex))).toContain( expect(stripAnsi(next.cliOutput.slice(outputIndex))).toContain(
'' + '' +
'\n ⨯ Error [TypeError]: fetch failed' + '\n ⨯ Error [TypeError]: fetch failed' +
'\n at anotherFetcher (src/fetcher.js:6:15)' + '\n at anotherFetcher (src/fetcher.js:6:16)' +
'\n at fetcher (src/fetcher.js:2:15)' + '\n at fetcher (src/fetcher.js:2:16)' +
'\n at UnknownDomainEndpoint (pages/api/unknown-domain.js:6:16)' + '\n at UnknownDomainEndpoint (pages/api/unknown-domain.js:6:16)' +
'\n 4 |' + '\n 4 |' +
'\n 5 | async function anotherFetcher(...args) {' + '\n 5 | async function anotherFetcher(...args) {' +
...@@ -44,7 +44,7 @@ describe('fetch failures have good stack traces in edge runtime', () => { ...@@ -44,7 +44,7 @@ describe('fetch failures have good stack traces in edge runtime', () => {
'\n ⨯ Error [TypeError]: fetch failed' '\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 // eslint-disable-next-line jest/no-standalone-expect
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
...@@ -57,7 +57,7 @@ describe('fetch failures have good stack traces in edge runtime', () => { ...@@ -57,7 +57,7 @@ describe('fetch failures have good stack traces in edge runtime', () => {
"stack": [ "stack": [
"anotherFetcher src/fetcher.js (6:16)", "anotherFetcher src/fetcher.js (6:16)",
"fetcher src/fetcher.js (2:16)", "fetcher src/fetcher.js (2:16)",
"UnknownDomainEndpoint pages/api/unknown-domain.js (6:${isTurbopack ? 15 : 16})", "UnknownDomainEndpoint pages/api/unknown-domain.js (6:16)",
], ],
} }
`) `)
......
...@@ -82,10 +82,11 @@ describe('build-output-prerender', () => { ...@@ -82,10 +82,11 @@ describe('build-output-prerender', () => {
// TODO(veil): Why is the location incomplete unless we enable --no-mangling? // TODO(veil): Why is the location incomplete unless we enable --no-mangling?
expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(` 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 "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() { 3 | export default function Page() {
4 | return <p>Current time: {new Date().toISOString()}</p> 4 | return <p>Current time: {new Date().toISOString()}</p>
> 5 | } > 5 | }
| ^
6 | 6 |
To get a more detailed stack trace and pinpoint the issue, try one of the following: 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. - Start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error.
...@@ -201,37 +202,9 @@ describe('build-output-prerender', () => { ...@@ -201,37 +202,9 @@ describe('build-output-prerender', () => {
}) })
it('shows all prerender errors with readable stacks and code frames', async () => { 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 <p>Current time: {new Date().toISOString()}</p>
| ^
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 <p>Random: {Math.random()}</p>
| ^
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(` 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 "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) at Page (bundler:///app/client/page.tsx:4:28)
2 | 2 |
3 | export default function Page() { 3 | export default function Page() {
> 4 | return <p>Current time: {new Date().toISOString()}</p> > 4 | return <p>Current time: {new Date().toISOString()}</p>
...@@ -241,7 +214,7 @@ describe('build-output-prerender', () => { ...@@ -241,7 +214,7 @@ describe('build-output-prerender', () => {
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. 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 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 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) at Page (bundler:///app/server/page.tsx:13:27)
11 | await cachedDelay() 11 | await cachedDelay()
12 | 12 |
> 13 | return <p>Random: {Math.random()}</p> > 13 | return <p>Random: {Math.random()}</p>
...@@ -255,7 +228,6 @@ describe('build-output-prerender', () => { ...@@ -255,7 +228,6 @@ describe('build-output-prerender', () => {
/client/page: /client /client/page: /client
/server/page: /server" /server/page: /server"
`) `)
}
}) })
}) })
}) })
...@@ -442,7 +414,11 @@ function getPrerenderOutput(cliOutput: string): string { ...@@ -442,7 +414,11 @@ function getPrerenderOutput(cliOutput: string): string {
if (foundPrerenderingLine && !line.includes('Generating static pages')) { if (foundPrerenderingLine && !line.includes('Generating static pages')) {
lines.push( lines.push(
line.replace(/at \w+ \(.next[^)]+\)/, 'at x (<next-dist-dir>)') line
.replace(/at \w+ \(.next[^)]+\)/, 'at x (<next-dist-dir>)')
// TODO(veil): Bundler protocols should not appear in stackframes.
.replace('webpack:///', 'bundler:///')
.replace('turbopack:///[project]/', 'bundler:///')
) )
} }
} }
......
...@@ -93,26 +93,29 @@ impl ReferencedAssetIdent { ...@@ -93,26 +93,29 @@ impl ReferencedAssetIdent {
ctxt, ctxt,
export, export,
} => { } => {
let ns = Ident::new(
namespace_ident.as_str().into(),
span,
ctxt.unwrap_or_default(),
);
if let Some(export) = export { if let Some(export) = export {
Either::Right(MemberExpr { Either::Right(MemberExpr {
span, 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 { prop: MemberProp::Computed(ComputedPropName {
span, span: DUMMY_SP,
expr: Box::new(Expr::Lit(Lit::Str(Str { expr: Box::new(Expr::Lit(Lit::Str(Str {
span, span: DUMMY_SP,
value: export.as_str().into(), value: export.as_str().into(),
raw: None, raw: None,
}))), }))),
}), }),
}) })
} else { } else {
Either::Left(ns) Either::Left(Ident::new(
namespace_ident.as_str().into(),
span,
ctxt.unwrap_or_default(),
))
} }
} }
} }
...@@ -125,13 +128,13 @@ impl ReferencedAssetIdent { ...@@ -125,13 +128,13 @@ impl ReferencedAssetIdent {
Expr::Seq(SeqExpr { Expr::Seq(SeqExpr {
exprs: vec![ exprs: vec![
Box::new(Expr::Lit(Lit::Num(Number { Box::new(Expr::Lit(Lit::Num(Number {
span, span: DUMMY_SP,
value: 0.0, value: 0.0,
raw: None, raw: None,
}))), }))),
Box::new(member.into()), Box::new(member.into()),
], ],
span, span: DUMMY_SP,
}) })
} else { } else {
member.into() member.into()
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
"sources": [], "sources": [],
"sections": [ "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": 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": 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,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,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,gPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG"}}, {"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": 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": 63, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":""}},
{"offset": {"line": 73, "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
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
"sources": [], "sources": [],
"sections": [ "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": 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": 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,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,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,uPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,uPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,uPAAA,CAAA,IAAG"}}, {"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": 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": 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
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
"sources": [], "sources": [],
"sections": [ "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": 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": 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,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,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,gPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,gPAAA,CAAA,IAAG"}}, {"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": 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": 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
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
"sources": [], "sources": [],
"sections": [ "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": 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": 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,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,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,yPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,yPAAA,CAAA,IAAG;AAQf,QAAQ,GAAG,CAAC,yPAAA,CAAA,IAAG"}}, {"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"}}] {"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
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"sources": [], "sources": [],
"sections": [ "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": 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]}}] {"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
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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]}}] {"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
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"sources": [], "sources": [],
"sections": [ "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": 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]}}] {"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
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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]}}] {"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
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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]}}] {"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
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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]}}] {"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
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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": 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
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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": 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
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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": 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
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"sources": [], "sources": [],
"sections": [ "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": 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]}}] {"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
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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": 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
{"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"} {"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 \ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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
...@@ -10,7 +10,7 @@ var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbo ...@@ -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" target: "e14dbx1z0"
})("background:blue;"); })("background:blue;");
function ClassNameButton({ children }) { function ClassNameButton({ children }) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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 <button\n className={css`\n background: blue;\n `}\n >\n {children}\n </button>\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 <button\n className={css`\n background: blue;\n `}\n >\n {children}\n </button>\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": 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": 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]}}] {"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]}}]
......
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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": 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
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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": 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
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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": 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
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"sources": [], "sources": [],
"sections": [ "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": 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": 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,+NAAA,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,0OAAG"}}]
} }
\ No newline at end of file
...@@ -7,5 +7,5 @@ ...@@ -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": 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": 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": 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
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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": 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": 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]}}] {"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]}}]
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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]}}] {"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
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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]}}] {"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
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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]}}] {"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
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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]}}] {"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
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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": 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
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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> = () => T\nexport function runExternalSourceMapped<T>(fn: Fn<T>): T {\n return fn()\n}\n"],"names":[],"mappings":";;;AAGM,SAAU,uBAAuB,CAAI,EAAS;IAClD,OAAO,EAAE,EAAE,CAAA;AACb,CAAC"}}, {"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> = () => T\nexport function runExternalSourceMapped<T>(fn: Fn<T>): 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
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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]}}] {"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
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"sources": [], "sources": [],
"sections": [ "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 <div>App</div>\n}\n"],"names":[],"mappings":";;;;;AAAe,SAAS;IACtB,qBAAO,0NAAC;kBAAI;;;;;;AACd"}}, {"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 <div>App</div>\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": 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 <div>Should not be transformed</div>;\n}\n"],"names":[],"mappings":";;;AAAe,SAAS;IACtB,QAAQ,IAAI,yBAAyB,EAAE;AACzC","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 <div>Should not be transformed</div>;\n}\n"],"names":[],"mappings":";;;AAAe,SAAS;IACtB,QAAQ,IAAI,yBAAyB,EAAE;AACzC","ignoreList":[0]}}]
} }
\ No newline at end of file
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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": 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
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"sources": [], "sources": [],
"sections": [ "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": 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]}}] {"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
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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]}}] {"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
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"version": 3, "version": 3,
"sources": [], "sources": [],
"sections": [ "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]}}] {"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
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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": 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
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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": 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
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"sources": [], "sources": [],
"sections": [ "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": 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment