Skip to content

Commit

Permalink
Fix missing devPageFiles collection (#54224)
Browse files Browse the repository at this point in the history
Closes #54168. This was accidentally removed from a code refactoring.
  • Loading branch information
shuding authored Aug 18, 2023
1 parent 803bbe5 commit ec43841
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/next/src/server/lib/router-utils/setup-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import { PageNotFoundError } from '../../../shared/lib/utils'
import { srcEmptySsgManifest } from '../../../build/webpack/plugins/build-manifest-plugin'
import { PropagateToWorkersField } from './types'
import { MiddlewareManifest } from '../../../build/webpack/plugins/middleware-plugin'
import { devPageFiles } from '../../../build/webpack/plugins/next-types-plugin/shared'

type SetupOpts = {
dir: string
Expand Down Expand Up @@ -815,6 +816,7 @@ async function startWatcher(opts: SetupOpts) {

appFiles.clear()
pageFiles.clear()
devPageFiles.clear()

const sortedKnownFiles: string[] = [...knownFiles.keys()].sort(
sortByPageExts(nextConfig.pageExtensions)
Expand Down Expand Up @@ -924,6 +926,9 @@ async function startWatcher(opts: SetupOpts) {
continue
}

// Collect all current filenames for the TS plugin to use
devPageFiles.add(fileName)

let pageName = absolutePathToPage(fileName, {
dir: isAppPath ? appDir! : pagesDir!,
extensions: nextConfig.pageExtensions,
Expand Down

0 comments on commit ec43841

Please sign in to comment.