Minimal example to reproduce microsoft/TypeScript#34869
git clone https://gist.github.com/b3e58e7eac7750faa235ef66bdb559ab.git
cd b3e58e7eac7750faa235ef66bdb559ab
npm install
npm run build
The last command runs tsc and will output
TypeError: Cannot read property 'valueDeclaration' of undefined