Files
Jiwon Choi 7e741b4207 Handle target option in React Compiler for Pages + React 18 (#91500)
### Why?

`test/e2e/app-dir/catch-error/catch-error-react-compiler.test.ts` is
skipped in CI due to incompatibility with React 18 tests.

```
Module not found: Can't resolve 'react/compiler-runtime'
> 1 | import { c as _c } from "react/compiler-runtime";
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

Failed CI:
https://github.com/vercel/next.js/actions/runs/23170738194/job/67327462789#step:36:317
x-ref:
https://react.dev/reference/react-compiler/target#targeting-react-17-or-18

---------

Co-authored-by: Sebastian "Sebbie" Silbermann <12292047+eps1lon@users.noreply.github.com>
Co-authored-by: Benjamin Woodruff <180404+bgw@users.noreply.github.com>
Co-authored-by: Sebastian Silbermann <eps1lon@users.noreply.github.com>
2026-04-09 15:21:29 +00:00

24 lines
620 B
TypeScript

'use client'
import { useEffect, useState } from 'react'
export default function Page() {
const [callFrame, setCallFrame] = useState<string | null>(null)
useEffect(() => {
const error = new Error('test-top-frame')
console.error(error)
const callStack = new Error('test-top-frame').stack!.split(
'test-top-frame\n'
)[1]
// indices might change due to different compiler optimizations
const callFrame = callStack.split('\n')[0]
setCallFrame(callFrame)
}, [])
return (
<pre data-testid="call-frame" aria-busy={callFrame === null}>
{String(callFrame)}
</pre>
)
}