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

Reload on message file updates #33

Closed
mattiloh opened this issue May 6, 2021 · 5 comments
Closed

Reload on message file updates #33

mattiloh opened this issue May 6, 2021 · 5 comments

Comments

@mattiloh
Copy link

mattiloh commented May 6, 2021

Hi @amannn!
First of all: Great work! I really like the simplicity and flexibility of this lib 👍

I started experimenting with it in a new project today (using next@10.2.0) and one thing is bothering me: I need to manually stop and restart the Next.js dev server to make updates on json message files visible. Do you have the same issue in your dev-setup or did you find a way to restart the server automatically?

@mattiloh
Copy link
Author

mattiloh commented May 6, 2021

Never mind. I don't know what I changed, but now the server restarts whenever I update the message files. I still need to manually reload the page to see the changes, but that's ok.

@mattiloh mattiloh closed this as completed May 6, 2021
@amannn
Copy link
Owner

amannn commented May 7, 2021

Hi @mattiloh,

thank you for giving next-intl a shot and your feedback! 🙂

The messages not updating sounds odd to me. I've just upgraded the example in this repo to the latest Next.js version and I get updated messages when I reload the page.

The update mechanism ultimately depends on how you provide your labels. If they're imported in client code statically, I think you'd even get Fast Refresh support. But if they come from getStaticProps and friends you need a page reload.

@mattiloh
Copy link
Author

mattiloh commented May 7, 2021

Yes, that's correct. I found this repo to get page-reloads for these cases: https://github.com/hashicorp/next-remote-watch

@amannn
Copy link
Owner

amannn commented May 7, 2021

Oh that's nice, thanks for sharing!

@kachkaev
Copy link

What’s the current recommended way of page reloading when translations change? next-remote-watch does not work with Next.js 13 and 14: hashicorp/next-remote-watch#52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants