-
Notifications
You must be signed in to change notification settings - Fork 26.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhandled Runtime Error Error: Expected a suspended thenable. This is a bug in React. Please file an issue. #51477
Comments
I had a similar issue, removing |
But we need it to be async in order to use await. |
Same error using next-intl in Server component. if the component is not async it works. |
@Vethavear If the function is async, you can just await the promise instead of wrapping it with |
@lshearer Not sure what you meant by your comment, because there are two options I see, and none of them manage to solve our issue:
|
You can solve it by the below link: |
useTranslations not working for server component with async you might need to use |
please , remove async syntax
export const Post = async () => {
const posts = use(getPosts())
......
}
export const Post = () => {
const posts = use(getPosts())
......
} |
Thanks for input guys, I guess this is outdated now as we can use getTranslations from next-intl/server |
Thanks |
Thanks |
In my case, the fix was to use |
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
--
To Reproduce
app/post/post.tsx
and this is where post component is used.
app/post/page.tsx
Describe the Bug
Expected Behavior
when remove async keyword in component, error not thrown.
Is it intended?
wonder why this
Which browser are you using? (if relevant)
Chrome 114.0.5735.106 (arm64)
How are you deploying your application? (if relevant)
localhost - yarn dev (development mode)
The text was updated successfully, but these errors were encountered: