Skip to content

Commit

Permalink
fix entrypoint sets
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Aug 12, 2022
1 parent b4ae9e9 commit 17ad000
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/next/server/dev/on-demand-entry-handler.ts
Expand Up @@ -350,8 +350,8 @@ export function onDemandEntryHandler({
const addPageEntry = (
compilerType: CompilerNameValues
): Promise<void> => {
let resolve: (value: void | PromiseLike<void>) => void,
reject: (reason?: any) => void
let resolve: (value: void | PromiseLike<void>) => void
let reject: (reason?: any) => void
const promise = new Promise<void>((res, rej) => {
resolve = res
reject = rej
Expand All @@ -360,11 +360,12 @@ export function onDemandEntryHandler({
const pageKey = `${compilerType}${pagePathData.page}`

if (entries[pageKey]) {
added.set(compilerType, promise)

entries[pageKey].dispose = false
entries[pageKey].lastActiveTime = Date.now()
if (entries[pageKey].status === BUILT) {
resolve!()
added.set(compilerType, promise)
return promise
}
} else {
Expand All @@ -374,6 +375,8 @@ export function onDemandEntryHandler({
) {
// Skip adding the client entry here.
} else {
added.set(compilerType, promise)

entryAdded = true
entries[pageKey] = {
type: EntryTypes.ENTRY,
Expand All @@ -384,7 +387,6 @@ export function onDemandEntryHandler({
lastActiveTime: Date.now(),
status: ADDED,
}
added.set(compilerType, promise)
}
}

Expand Down

0 comments on commit 17ad000

Please sign in to comment.