Define multiple IntlMessages types for use in monorepo #1224
Unanswered
jonathanwilke
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Hmm, sounds like an issue with how types are used in the respective packages? Can you maybe skip the type check of the email package when building the main app? Sounds like something you might want to do anyway for perf reasons, as long as the email package takes care of checking its types internally? Maybe something like |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there,
I am using next-intl in a monorepo and I am trying to get next-intl running in a lib there that defines my mail templates with react-email. I have two global.d.ts files that define IntlMessages, one in my main project (a Next.js app) and one in the library for the mail templates. The main app imports the mail templates from the library to send the mails. In the editor everything works fine with the types, but if I try to build the app, I get the error that the messages I pass to the createTranslator method are not valid in the mail template library. I suppose this is due to the fact the it takes the IntlMessages type from my main app, which of course does not match the messages of the mail template library.
Is there any way how I can define override the types for a specific instance of the createTranslator method or any other way to fix this?
Beta Was this translation helpful? Give feedback.
All reactions