TS1006

error TS1006: A file cannot have a reference to itself.

Broken Code ❌

index.d.ts
1
/// <reference path='index.d.ts' />

Fixed Code ✔️

You cannot reference a file to itself (causes recursive loop). To fix the problem you have to update the reference path to point to another declaration file:

index.d.ts
1
/// <reference path='some-other-file.d.ts' />