Skip to content

Commit

Permalink
Improve type coverage of setup-dev-bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Oct 17, 2024
1 parent 8eb2a51 commit 566d0b1
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 @@ -111,7 +111,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 @@ -134,7 +134,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 @@ -955,7 +956,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 566d0b1

Please sign in to comment.