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
// shared/use-thing.ts
import { thing } from './Thing' // Thing.mobile.ts exists
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.
Summary
The
typescriptCheckPluginadded in #11450 generates a scratch tsconfig that setscompilerOptions.moduleSuffixesto a fixed['.<platform>', '.native', ''](fromgetModuleSuffixes()inhelpers/typescript-check.js). This overrides the project's ownmoduleSuffixeschain instead of extending it, so files carrying custom suffix tiers — e.g. a shared-mobile.mobiletier 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 viaresolve.extensions.Reproduction
ns build ios --env.typecheckreportsCannot find module './Thing';tsc -p tsconfig.jsonis clean.Suggested fix
Either:
moduleSuffixeswith the generated ones (project chain takes precedence, or append the generated entries), ormoduleSuffixesdirectly — the scratch config alreadyextendsthe project tsconfig, so simply dropping the override when the project declaresmoduleSuffixeswould work.Happy to send a PR if either direction sounds right.