You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use ReturnType<typeof useTranslations> in my code (src/utils.ts) with large translation files, I get a "Expression produces a union type that is too complex to represent" error. The error disappears if I replace the translation files with smaller ones. How to work around this typescript limitation?
The createPage function is used to inject the translation function t into pages and to call setRequestLocale function automatically on static pages.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I use
ReturnType<typeof useTranslations>
in my code (src/utils.ts
) with large translation files, I get a "Expression produces a union type that is too complex to represent" error. The error disappears if I replace the translation files with smaller ones. How to work around this typescript limitation?The
createPage
function is used to inject the translation functiont
into pages and to callsetRequestLocale
function automatically on static pages.Reproduction: https://codesandbox.io/p/devbox/next-intl-demo-74xj7f
How to reproduce: try to build the project via
pnpm build
command.Beta Was this translation helpful? Give feedback.
All reactions