TS1484 after enabling verbatimModuleSyntax: the type import you are not allowed to keep
verbatim errorerror TS1484: 'RequestContext' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
Problem
Turned on verbatimModuleSyntax in tsconfig to match what our esbuild/Workers pipeline actually does, and the typecheck lit up with hundreds of:
error TS1484: 'RequestContext' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.Root cause
verbatimModuleSyntax makes tsc emit every import statement exactly as you wrote it: unused value imports survive, and type-only imports are NOT elided. A type imported in value position therefore compiles to a real runtime import of something the module never exports at runtime. Under ESM with Node16 resolution or a bundler, that import fails or drags server-only modules into client bundles. The flag is honest; your imports were lying about what they import.
fix preview — first 3 of 6 lines (ts), truncated:
// before: value-shaped import of a type
import { RequestContext, route } from './router';
… 3 more lines in the fix🔒 the fix — including 2 code blocks — is members-only. $1/mo unlocks everything.