An import resolves to a file that TypeScript treats as a script rather than an importable module. This commonly occurs when a local helper file has declarations but no exports.
A helper file contains declarations without imports or exports and is treated as a script.
An import points to an empty or unintended file.
A declaration file describes globals but is being consumed as though it exports named members.
How to fix it
Check the file path in the diagnostic before editing compiler options. Confirm it is the file you intended to import.
If a helper should be imported, export it explicitly: export const limit = 10 in limits.ts pairs with import { limit } from './limits'.
Use export {} only when the goal is module scope without exported members. It does not expose existing declarations and will not make a named import valid.
For a global declaration file, decide whether the types should remain global or become module exports. Adding export {} changes scope, so do not apply it blindly to existing ambient declarations.
Run the project type checker again and verify any consumers of the changed declarations. Module detection also depends on compiler configuration, so compare the editor's project with the command-line project if results differ.