Closed as not planned
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:08:47 PST 2022; root:xnu-8792.61.2~4/RELEASE_X86_64
Binaries:
Node: 16.16.0
npm: 8.11.0
Yarn: 1.22.18
pnpm: 7.1.7
Relevant packages:
next: 13.1.2-canary.4
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue
https://github.com/amannn/nextjs-bug-use-server
To Reproduce
- Clone the repro
- Run
npm run dev
- Access http://localhost:3000
Describe the Bug
If I make use of use in an async component, this throws:
Expected Behavior
I understand that in an async component you'd typically use async
/await
. However for reusable library code that can be executed either on the server or the client side, it would be very helpful if use
can be called in server code as well.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response