Skip to content

Commit

Permalink
Improve type coverage of setup-dev-bundler (#71443)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Oct 22, 2024
1 parent 5bdf915 commit 08cd0e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export async function createOriginalStackFrame({
rootDirectory: string
frame: StackFrame
errorMessage?: string
}): Promise<OriginalStackFrameResponse | undefined> {
}): Promise<OriginalStackFrameResponse | null> {
const { lineNumber, column } = frame
const moduleNotFound = findModuleNotFoundFromError(errorMessage)
const result = await (async () => {
Expand All @@ -136,7 +136,7 @@ export async function createOriginalStackFrame({
})()

if (!result?.sourcePosition.source) {
return undefined
return null
}

const { sourcePosition, sourceContent } = result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import {
batchedTraceSource,
createOriginalStackFrame as createOriginalTurboStackFrame,
} from '../../../client/components/react-dev-overlay/server/middleware-turbopack'
import type { OriginalStackFrameResponse } from '../../../client/components/react-dev-overlay/server/shared'
import { devPageFiles } from '../../../build/webpack/plugins/next-types-plugin/shared'
import type { LazyRenderServerInstance } from '../router-server'
import { HMR_ACTIONS_SENT_TO_BROWSER } from '../../dev/hot-reloader-types'
Expand Down Expand Up @@ -1003,7 +1004,8 @@ async function startWatcher(opts: SetupOpts) {
!file?.includes('<anonymous>')
)

let originalFrame, isEdgeCompiler
let originalFrame: OriginalStackFrameResponse | null = null
let isEdgeCompiler = false
const frameFile = frame?.file
if (frame?.lineNumber && frameFile) {
if (hotReloader.turbopackProject) {
Expand Down

0 comments on commit 08cd0e6

Please sign in to comment.