Skip to content

Commit

Permalink
ensure DIO development segment errors are cleared after correcting
Browse files Browse the repository at this point in the history
  • Loading branch information
ztanner committed Oct 24, 2024
1 parent 5ab28cd commit f96eaa9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ async function startWatcher(opts: SetupOpts) {
let enabledTypeScript = usingTypeScript
let previousClientRouterFilters: any
let previousConflictingPagePaths: Set<string> = new Set()
let previouslyHadSegmentError = false

wp.on('aggregated', async () => {
let middlewareMatchers: MiddlewareMatcher[] | undefined
Expand Down Expand Up @@ -569,6 +570,8 @@ async function startWatcher(opts: SetupOpts) {
const errorMessage = `The following pages used segment configs which are not supported with "experimental.dynamicIO" and must be removed to build your application:\n${pagesWithIncompatibleSegmentConfigs.join('\n')}\n`
Log.error(errorMessage)
hotReloader.setHmrServerError(new Error(errorMessage))
} else if (previouslyHadSegmentError) {
hotReloader.clearHmrServerError()
}
}

Expand Down

0 comments on commit f96eaa9

Please sign in to comment.