Top-level await causes the client component to report an error. Element type is invalid. Received a promise that resolves to: undefined. Lazy element type must resolve to a class or function. #62763
Labels
bug
Issue was opened via the bug report template.
Link to the code that reproduces this issue
https://github.com/Innei/nextjs-top-level-reproduction
To Reproduce
Write a client component like this.
and import this in root component.
Current vs. Expected behavior
current:
Error: Element type is invalid. Received a promise that resolves to: undefined. Lazy element type must resolve to a class or function.
Expected: DONT crash
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.3.0: Wed Dec 20 21:31:00 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6020 Binaries: Node: 20.8.1 npm: 10.2.4 Yarn: 1.22.19 pnpm: 8.14.1 Relevant Packages: next: 14.1.1 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 5.3.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
App Router
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: