How to have i18n.ts come along with the build? #480
-
I'm trying out the translations server side. It works in development, but I'm running into an issue when built. The build runs fine, but when I run the app afterwards it exits with the message that it can't find 'i18n.ts'. What is the best approach to have this file come along in the build? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Make sure you add it to your tsconfig.json? Where are you locating/importing it, what's the error message? |
Beta Was this translation helpful? Give feedback.
-
I'm following the docs https://next-intl-docs.vercel.app/docs/getting-started/app-router-server-components#i18nts Didn't think much of it, but when building and then launching I get the following in the console:
Looking at the code in the docs again I see that |
Beta Was this translation helpful? Give feedback.
That's a great point, thanks for pointing this out @boris-arkenaar! We only need the
i18n.ts
file duringnext dev
andnext build
, not duringnext start
.I've addressed this in d4eee0d, the next RSC beta release will no longer require the file to be present after the build.