Skip to content
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

Bug: useMessages is not callable within an async component #635

Closed
LiuCaptain opened this issue Nov 16, 2023 · 3 comments
Closed

Bug: useMessages is not callable within an async component #635

LiuCaptain opened this issue Nov 16, 2023 · 3 comments
Labels
bug Something isn't working unconfirmed Needs triage.

Comments

@LiuCaptain
Copy link

Description

I saw an introduction to 'Server&Client Components' in the document:
image

But when I was using it, I reported an error:
image

This is my code:
image

So can I only import messages through import()?

Mandatory reproduction URL (CodeSandbox or GitHub repository)

not have

Reproduction description

as mentioned above,thank you !

Expected behaviour

Please tell me what to do, thank you very much!

@LiuCaptain LiuCaptain added bug Something isn't working unconfirmed Needs triage. labels Nov 16, 2023
@amannn amannn closed this as completed in 14031da Nov 16, 2023
@amannn
Copy link
Owner

amannn commented Nov 16, 2023

Thanks for the report! I've just fixed this in the docs (see 14031da).

@di-sukharev
Copy link

what if i have an async component?

@erwanriou
Copy link

erwanriou commented Apr 6, 2024

use

import { getMessages } from "next-intl/server"

const messages = await getMessages();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

4 participants