Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(next): use moduleGraph.getIssuer to avoid deprecation warning (#36329) #36330

Merged
merged 3 commits into from Apr 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions packages/next/server/dev/hot-reloader.ts
Expand Up @@ -106,12 +106,16 @@ const matchNextPageBundleRequest = route(
)

// Recursively look up the issuer till it ends up at the root
function findEntryModule(issuer: any): any {
if (issuer.issuer) {
return findEntryModule(issuer.issuer)
function findEntryModule(
compilation: webpack5.Compilation,
issuerModule: any
): any {
const issuer = compilation.moduleGraph.getIssuer(issuerModule)
if (issuer) {
return findEntryModule(compilation, issuer)
}

return issuer
return issuerModule
}

function erroredPages(compilation: webpack5.Compilation) {
Expand All @@ -121,7 +125,7 @@ function erroredPages(compilation: webpack5.Compilation) {
continue
}

const entryModule = findEntryModule(error.module)
const entryModule = findEntryModule(compilation, error.module)
const { name } = entryModule
if (!name) {
continue
Expand Down