From b3c95744efbf03cbe16f4043111c1fceef638acb Mon Sep 17 00:00:00 2001 From: Weiko Date: Fri, 6 Feb 2026 12:17:11 +0100 Subject: [PATCH] Fix twenty-emails build (#17760) ## Context I've seen errors in twenty-emails build where I18n from @lingui/core was resolved to two different declaration files ```typescript src/components/BaseEmail.tsx:20:19 - error TS2719: Type 'import("/Users/weiko/Projects/twenty/node_modules/@lingui/core/dist/index").I18n' is not assignable to type 'import("/Users/weiko/Projects/twenty/node_modules/@lingui/core/dist/index").I18n'. Two different types with this name exist, but they are unrelated. Types have separate declarations of a private property '_locale'. 20 ~~~~ node_modules/@lingui/react/dist/shared/react.b2b749a9.d.ts:42:5 42 i18n: I18n; ~~~~ The expected type comes from property 'i18n' which is declared here on type 'IntrinsicAttributes & Omit & { children?: ReactNode; }' ``` Seems to be related to https://github.com/twentyhq/twenty/pull/17380 The tsconfig simplification changed how vite plugin resolves types during build. With the inherited moduleResolution: "node", the plugin and source code resolved @lingui/react's types differently, creating two incompatible I18n types from the same package. ## Fix Add moduleResolution: "bundler" to packages/twenty-emails/tsconfig.json, aligning with twenty-front, twenty-ui, twenty-shared should fix the issue --- packages/twenty-emails/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/twenty-emails/tsconfig.json b/packages/twenty-emails/tsconfig.json index 8c1ab2e0c2..03000a6d4f 100644 --- a/packages/twenty-emails/tsconfig.json +++ b/packages/twenty-emails/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "jsx": "react-jsx", + "moduleResolution": "bundler", "allowJs": false, "esModuleInterop": false, "allowSyntheticDefaultImports": true,