Unverified Commit fd73584c authored by OJ Kwon's avatar OJ Kwon Committed by GitHub

fix(turbopack): throws api issues (#64032)

### What

Correctly raises error for the /api, unlike other places we were
suppressing it.

Closes PACK-2900
parent dbd66e47
...@@ -195,6 +195,9 @@ export function processIssues( ...@@ -195,6 +195,9 @@ export function processIssues(
if (issue.severity !== 'warning') { if (issue.severity !== 'warning') {
relevantIssues.add(formatted) relevantIssues.add(formatted)
if (isWellKnownError(issue)) {
Log.error(formatted)
}
} }
} }
...@@ -406,7 +409,7 @@ export async function handleRouteType({ ...@@ -406,7 +409,7 @@ export async function handleRouteType({
pageEntrypoints: entrypoints.page, pageEntrypoints: entrypoints.page,
}) })
processIssues(currentEntryIssues, key, writtenEndpoint) processIssues(currentEntryIssues, key, writtenEndpoint, true)
break break
} }
......
...@@ -73,10 +73,12 @@ export function expectModuleNotFoundProdError( ...@@ -73,10 +73,12 @@ export function expectModuleNotFoundProdError(
) { ) {
const moduleNotSupportedMessage = getUnsupportedModule(moduleName) const moduleNotSupportedMessage = getUnsupportedModule(moduleName)
expect(stripAnsi(output)).not.toContain(moduleNotSupportedMessage) expect(stripAnsi(output)).not.toContain(moduleNotSupportedMessage)
const moduleNotFoundMessage = process.env.TURBOPACK const moduleNotFoundMessages = [
? `Error: Cannot find module '${moduleName}'` expect.stringContaining(`Error: Cannot find module '${moduleName}'`),
: getModuleNotFound(moduleName) expect.stringContaining(getModuleNotFound(moduleName)),
expect(stripAnsi(output)).toContain(moduleNotFoundMessage) ]
expect(moduleNotFoundMessages).toContainEqual(stripAnsi(output))
} }
export function expectModuleNotFoundDevError( export function expectModuleNotFoundDevError(
......
...@@ -9651,12 +9651,11 @@ ...@@ -9651,12 +9651,11 @@
"Edge runtime code with imports Edge API statically importing node.js module throws unsupported module error in dev at runtime and highlights the faulty line", "Edge runtime code with imports Edge API statically importing node.js module throws unsupported module error in dev at runtime and highlights the faulty line",
"Edge runtime code with imports Middleware dynamically importing 3rd party module throws not-found module error in dev at runtime and highlights the faulty line", "Edge runtime code with imports Middleware dynamically importing 3rd party module throws not-found module error in dev at runtime and highlights the faulty line",
"Edge runtime code with imports Middleware importing unused node.js module does not throw in dev at runtime", "Edge runtime code with imports Middleware importing unused node.js module does not throw in dev at runtime",
"Edge runtime code with imports Middleware statically importing node.js module throws unsupported module error in dev at runtime and highlights the faulty line" "Edge runtime code with imports Middleware statically importing node.js module throws unsupported module error in dev at runtime and highlights the faulty line",
],
"failed": [
"Edge runtime code with imports Edge API importing unused 3rd party module throws not-found module error in dev at runtime and highlights the faulty line", "Edge runtime code with imports Edge API importing unused 3rd party module throws not-found module error in dev at runtime and highlights the faulty line",
"Edge runtime code with imports Middleware importing unused 3rd party module throws not-found module error in dev at runtime and highlights the faulty line" "Edge runtime code with imports Middleware importing unused 3rd party module throws not-found module error in dev at runtime and highlights the faulty line"
], ],
"failed": [],
"pending": [ "pending": [
"Edge runtime code with imports Edge API dynamically importing 3rd party module production mode does not build and reports module not found error", "Edge runtime code with imports Edge API dynamically importing 3rd party module production mode does not build and reports module not found error",
"Edge runtime code with imports Edge API importing unused 3rd party module production mode does not build and reports module not found error", "Edge runtime code with imports Edge API importing unused 3rd party module production mode does not build and reports module not found error",
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment