mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
7e741b4207
### 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>
24 lines
620 B
TypeScript
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>
|
|
)
|
|
}
|