fix(turbopack): throws api issues (#64032)
### What Correctly raises error for the /api, unlike other places we were suppressing it. Closes PACK-2900
This commit is contained in:
parent
dbd66e478f
commit
fd73584c7f
3 changed files with 12 additions and 8 deletions
|
@ -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({
|
||||||
pageEntrypoints: entrypoints.page,
|
pageEntrypoints: entrypoints.page,
|
||||||
})
|
})
|
||||||
|
|
||||||
processIssues(currentEntryIssues, key, writtenEndpoint)
|
processIssues(currentEntryIssues, key, writtenEndpoint, true)
|
||||||
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 @@
|
||||||
"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",
|
||||||
|
|
Loading…
Reference in a new issue