TS2691

error TS2691: An import path cannot end with a ‘.d.ts’ extension. Consider importing ‘./index’ instead.

Broken Code ❌

You cannot directly import code from declaration files:

1
import { myFunction } from './index.d.ts';

Fixed Code ✔️

You have to import functions from the source code file (e.g. index.ts):

1
import { myFunction } from './index';