Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Ambient types are not automatically discovered #31

Closed
alexeagle opened this issue Sep 9, 2017 · 0 comments
Closed

Ambient types are not automatically discovered #31

alexeagle opened this issue Sep 9, 2017 · 0 comments
Assignees
Labels

Comments

@alexeagle
Copy link
Contributor

By default, TypeScript discovers ambient types under node_modules/@types/* to be resolvable. For example, a .ts file can just contain import * as fs from 'fs' and it works if the node typings are installed.

Under bazel the types must be explicitly referenced, eg.
/// <reference types="node"/>

It doesn't help to list the types in the tsconfig compilerOptions.types[] which is not surprising since IIUC that only restricts which types the compiler includes in resolution.

We noticed this yesterday in the Angular team (cc @matsko and @IgorMinar), independently reported in #30.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant