oscklmO
Convex Communityβ€’14mo agoβ€’
20 replies
oscklm

Issue with convex being picked up by `npx tsc` in expo project

Hello, was hoping some typescript wizard could help me out here. I've been trying to configure my repos tsconfig to not clash with the tsconfig.json in our convex/ folder.

The problem
Whenever i run npx tsc to check for any typescript compile errors from the root of my repo, it picks up on some files in my projects from the convex/ and says there are errors.

Found 15 errors in 6 files.

Errors  Files
     1  convex/activity/mutations.ts:68
     2  convex/auth/CustomPassword.tsx:1
     5  convex/auth/resend/PasswordResetConfig.tsx:1
     5  convex/auth/resend/VerifyEmailConfig.tsx:1
     1  convex/core/migrations.ts:47
     1  node_modules/convex-helpers/server/zod.ts:443


But convex/ has its own tsconfig (the default one from convex), and when running npx tsc if i cd into the convex folder, i get none of those errors as stated above. So only running tsc in the root says errors are present in a few convex folder files.

I'm using this tsconfig, since im in a expo project:
{
  "extends": "expo/tsconfig.base",
  "compilerOptions": {
    "strict": true,
    "skipLibCheck": true,
    "paths": {
      "@/*": ["./*"]
    },
    "moduleSuffixes": [".ios", ".android", ".native", ""]
  },
  "exclude": ["convex/**/*"],
  "include": ["**/*.tsx", "**/*.ts", ".expo/types/**/*.ts", "expo-env.d.ts", "vitest.config.mts"]
}


I've tried a few things:
- Removed the "**/*.tsx", "**/*.ts" from the include, as i thought maybe those were overwriting the exclude i added, but that messed all my path imports up in my project.
- Playing around with multiple different glob patterns for the excludes, but without luck
- Tried setting up a reference in the root tsconfig to the one in convex/ but that didn't work out due to "noEmit": true in the convex tsconfig
Was this page helpful?