What this thread does
The problem
An agent updates TypeScript or a template and the build rejects config, imports, typings or syntax. Choose from the first diagnostic and its file path.
Version boundaries, checked 2026-10-20
| Official source | Boundary | Meaning |
|---|---|---|
| TypeScript 6.0 | baseUrl deprecated; removal in 7.0 | Migrate config. |
| verbatimModuleSyntax | Introduced in 5.0 | Mark type imports. |
| TypeScript 5.8 | erasableSyntaxOnly introduced | Reject runtime-generating syntax. |
These are feature boundaries, not latest-patch claims. No priced option or licence comparison is involved.
Which fix to choose
| Failure | Repair | Preserve |
|---|---|---|
| Config deprecation | Rebase paths; remove baseUrl | Import targets |
| Type imported as value | import type | Runtime imports/side effects |
| Declarations not found | Bundled types, compatible @types or local declarations | Type coverage |
| Non-erasable syntax | Plain JavaScript plus types | Runtime behaviour |
Record compiler/config before editing. Examples assume pnpm and installed dependencies; keep the project's manager.
pnpm exec tsc --version
pnpm exec tsc --showConfig -p tsconfig.json
pnpm exec tsc --noEmit -p tsconfig.json
Option 'baseUrl' is deprecated
The exact message is Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Verified in Jasperan's report, checked 2026-10-20.
A retained option triggers the diagnostic. If baseUrl was ./src and @app/* mapped to app/*, remove baseUrl and change the target to ./src/app/*. With baseUrl . and config-relative targets, no target change may be needed. Inspect inherited configs; rerun the commands above and the project build. Official migration, checked 2026-10-20.
Do not remove it without checking targets or add catch-all paths blindly. A temporary "ignoreDeprecations": "6.0" bridge is documented, but is not migration. Paths do not rewrite emitted imports; runtime alias wiring is separate. Official announcement and module reference, checked 2026-10-20.
TS1484 and type imports
The exact diagnostic is error TS1484: 'StateMap' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled. The Vue/Vite report places it in dependency .vue source, checked 2026-10-20.
A type-only symbol is imported using value-import syntax. In owned code use import type { StateMap } from './state', keeping the real specifier. Mixed imports can use import { createState, type StateMap } from './state'. Preserve required side-effect imports. Run pnpm exec tsc --noEmit -p tsconfig.json, or the existing Vue type-check script if vue-tsc failed. Official semantics, checked 2026-10-20.
Do not convert runtime functions/classes into type imports. For dependency source, use a compatible upstream release or recorded dependency patch and rerun that build. App edits cannot repair the dependency; skipLibCheck does not promise to skip .vue source. Hand-editing node_modules is not durable.
Missing declaration file
The exact message is Could not find a declaration file for module 'gettext.js'. Krisztián Balla's report describes JavaScript resolving without located declarations, checked 2026-10-20.
Inspect package types/exports, type-package compatibility and resolution:
pnpm exec tsc --noEmit --traceResolution -p tsconfig.json
npm view @types/gettext.js version
The latter checks availability only. If compatible typings exist, install with the project's manager, e.g. pnpm add -D @types/gettext.js, and rerun the check. Otherwise write a local .d.ts describing the actual exports used, include it in the project and verify resolution. Official declarations guide, module template and resolution tracing, checked 2026-10-20.
Do not add baseUrl to copy the old SO answer. Bare declare module 'gettext.js';, disabling noImplicitAny or ts-ignore does not restore type safety. Import type cannot create missing declarations.
erasableSyntaxOnly
The exact message is This syntax is not allowed when 'erasableSyntaxOnly' is enabled. Verified in the official 5.8 example, checked 2026-10-20.
The construct needs JavaScript generation beyond stripping. Replace constructor(public x: number) {} with an explicit x: number field and constructor(x: number) { this.x = x; }. Replace enums with constants/types only after checking values, reverse lookups and callers. Run pnpm exec tsc --noEmit -p tsconfig.json and existing runtime tests. Official option reference, checked 2026-10-20.
Do not simply disable the flag when relying on native type stripping. Keeping runtime-generating syntax requires a build/runtime that transforms it.
What the community says
- cecilyhunt's Google migration feedback reports rebasing baseUrl mappings; TypeScript maintainer DanielRosenwasser follows up. A migration account, not a survey; checked 2026-10-20.
- lijinxiao1982's Hermes issue reports TS1484 after moving types. Radu-Cristian-Toma independently reports a successful build with inline type modifiers. These are their tests; checked 2026-10-20.
- privatenumber's README calls the symptom “verbatimModuleSyntax errors” and offers preview mode. No repair tool was installed; checked 2026-10-20.
A prompt to give your agent
Read the linked official source for the exact diagnostic before fixing it; do not guess from its number. Report installed compiler, effective config and failing file. Distinguish owned code, dependency source and declarations. Choose one repair, preserve runtime imports/alias targets, then run existing type checks and builds. Report remaining errors without weakening strictness.
Limits
No compiler, install or app build was run. All four supplied message strings were verified; additional variants are unverified. Vue/gettext reports are small or historical demand samples. Current @types/gettext.js availability/version was not independently confirmed from its registry page; npm view is a prerequisite. No patch-version recommendation is made. Community engagement was not recounted; no public demand count was found for erasableSyntaxOnly. Native Node syntax failures and LSP performance are separate jobs.
Started from a post by @cecilyhunt, packaged by the editor. Original post