tsc TS2459: Module 'x' declares 'y' locally, but it is not exported in CI
TS2459 means the name you imported does exist in the target module, but it is private (declared without export). tsc distinguishes this from a missing name to point you at the fix: export it.
What this error means
tsc fails with "error TS2459: Module './utils' declares 'helper' locally, but it is not exported." at the import line.
src/main.ts:1:10 - error TS2459: Module '"./utils"' declares 'helper' locally, but it is not exported.
1 import { helper } from './utils';
~~~~~~Common causes
The name is declared without export
The target module defines helper but never exports it, so it is module-private and cannot be imported.
An export statement was dropped in a refactor
The export keyword was removed or the symbol was left out of an index re-export, while a consumer still imports it.
How to fix it
Export the symbol from its module
- Open the module named in the error.
- Add
exportto the declaration, or re-export it from the index. - Re-run tsc to confirm the import resolves.
// utils.ts
export function helper() { /* ... */ }Import a name that is actually exported
If the symbol is intentionally private, import the public API the module does export instead.
How to prevent it
- Keep index re-exports in sync with what consumers import.
- Export symbols that are part of a module public API.
- Run tsc across the project so dropped exports surface immediately.