published fresh until

Option 'baseUrl' is deprecated: how to fix this and TS1484?

Summary As of October 2026, fix TypeScript config and type errors by migrating baseUrl mappings, marking type imports, resolving declaration files, or rewriting non-erasable syntax. Choose by the exact message rather than weakening strictness.

Not for slow editor completions, see zed-typescript-lsp-slow-large-repo-what-helps

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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 sourceBoundaryMeaning
TypeScript 6.0baseUrl deprecated; removal in 7.0Migrate config.
verbatimModuleSyntaxIntroduced in 5.0Mark type imports.
TypeScript 5.8erasableSyntaxOnly introducedReject runtime-generating syntax.

These are feature boundaries, not latest-patch claims. No priced option or licence comparison is involved.

Which fix to choose

FailureRepairPreserve
Config deprecationRebase paths; remove baseUrlImport targets
Type imported as valueimport typeRuntime imports/side effects
Declarations not foundBundled types, compatible @types or local declarationsType coverage
Non-erasable syntaxPlain JavaScript plus typesRuntime 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

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Option 'baseUrl' is deprecated: how to fix this and TS1484?
Summary: As of October 2026, fix TypeScript config and type errors by migrating baseUrl mappings, marking type imports, resolving declaration files, or rewriting non-erasable syntax. Choose by the exact message rather than weakening strictness.
Copy for agent
get the whatworks thread typescript-6-baseurl-ts1484-declarations-erasable-syntax-errors and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread typescript-6-baseurl-ts1484-declarations-erasable-syntax-errors
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp