Skip to content

Commit a577e6e

Browse files
committed
Always log from get-page-static as dev-turbo has log bug
1 parent e98ca8a commit a577e6e

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

packages/next/src/build/analysis/get-page-static-info.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,7 @@ export async function getPagesPageStaticInfo({
768768

769769
let resolvedRuntime = config.runtime ?? config.config?.runtime
770770

771-
// Turbopack will handle error during compilation with better code frame.
772-
if (!process.env.TURBOPACK && isProxyFile(page) && resolvedRuntime) {
771+
if (isProxyFile(page) && resolvedRuntime) {
773772
const relativePath = relative(process.cwd(), pageFilePath)
774773
const resolvedPath = relativePath.startsWith('.')
775774
? relativePath

test/e2e/app-dir/proxy-runtime/proxy-runtime.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ describe('proxy-missing-export', () => {
2424
cliOutput = (await next.build()).cliOutput
2525
}
2626

27-
if (process.env.IS_TURBOPACK_TEST) {
28-
if (isNextDev) {
29-
// TODO: Investigate why in dev-turbo, the error is shown in the browser console, not CLI output.
30-
} else {
31-
expect(stripAnsi(cliOutput)).toContain(`proxy.ts:3:14
27+
// TODO: Investigate why in dev-turbo, the error is shown in the browser console, not CLI output.
28+
if (process.env.IS_TURBOPACK_TEST && !isNextDev) {
29+
expect(stripAnsi(cliOutput)).toContain(`proxy.ts:3:14
3230
Next.js can't recognize the exported \`config\` field in route. Proxy does not support Edge runtime.
3331
1 | export default function () {}
3432
2 |
@@ -37,7 +35,6 @@ Next.js can't recognize the exported \`config\` field in route. Proxy does not s
3735
4 |
3836
3937
The exported configuration object in a source file needs to have a very specific format from which some properties can be statically parsed at compiled-time.`)
40-
}
4138
} else {
4239
expect(cliOutput).toContain(
4340
`Route segment config is not allowed in Proxy file at "./proxy.ts". Proxy always runs on Node.js runtime. Learn more: https://nextjs.org/docs/messages/middleware-to-proxy`

0 commit comments

Comments
 (0)