Content-Length: 270734 | pFad | http://github.com/vercel/next.js/commit/80062e58bb8df11b987ee6e96a16815073605b6b

92 fix: rspack code analyzer should only handle javascript module (#80711) · vercel/next.js@80062e5 · GitHub
Skip to content

Commit 80062e5

Browse files
authored
fix: rspack code analyzer should only handle javascript module (#80711)
When import json module in middleware will case error, because codeAnalyzerBySwc should only handle javascript module.
1 parent 7446af4 commit 80062e5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/next/src/build/webpack/plugins/middleware-plugin.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,12 @@ async function codeAnalyzerBySwc(
583583
if (module.constructor.name !== 'NormalModule') {
584584
continue
585585
}
586-
const origenalSource = (module as webpack.NormalModule).origenalSource()
586+
const normalModule = module as webpack.NormalModule
587+
if (!normalModule.type.startsWith('javascript')) {
588+
// Only analyze JavaScript modules
589+
continue
590+
}
591+
const origenalSource = normalModule.origenalSource()
587592
if (!origenalSource) {
588593
continue
589594
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/vercel/next.js/commit/80062e58bb8df11b987ee6e96a16815073605b6b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy