#11480·NativeScript

vite type check: generated moduleSuffixes override the project's chain

Author: aleclarsonCreated Sep 30, 2026Updated Sep 30, 2026

Summary

The typescriptCheckPlugin added in #11450 generates a scratch tsconfig that sets compilerOptions.moduleSuffixes to a fixed ['.<platform>', '.native', ''] (from getModuleSuffixes() in helpers/typescript-check.js). This overrides the project's own moduleSuffixes chain instead of extending it, so files carrying custom suffix tiers — e.g. a shared-mobile .mobile tier that app code and third-party libraries use between the OS qualifier and the unsuffixed default — fail the build-time type check with TS2307 even though the same imports resolve in the app's own tsconfig and at bundle time via resolve.extensions.

Reproduction

typescript
// shared/use-thing.ts
import { thing } from './Thing'   // Thing.mobile.ts exists
jsonc
// app tsconfig
{ "compilerOptions": { "moduleSuffixes": [".ios", ".android", ".mobile", ""] } }

ns build ios --env.typecheck reports Cannot find module './Thing'; tsc -p tsconfig.json is clean.

Suggested fix

Either:

  • merge the project's moduleSuffixes with the generated ones (project chain takes precedence, or append the generated entries), or
  • derive the generated chain from the project's moduleSuffixes directly — the scratch config already extends the project tsconfig, so simply dropping the override when the project declares moduleSuffixes would work.

Happy to send a PR if either direction sounds right.

Source: NativeScript/NativeScript