Ask coding questions

← Back to all posts
Importing Typescript libraries wit @types
h
OctavicSensei

https://repl.it/@YifeiXu/Typescript-test-real

I'm trying to import lodash, which is an npm module with its type declaration stored under @types/lodash. Pretty common for TS modules. But I was unable to import the library. Without adding @types/lodash I get compiler error, with it everything I import from the library is undefined.

Seems to be a problem in module resolution.

Voters
cowjuh
RobiertDanties
OctavicSensei
Comments
hotnewtop
OctavicSensei

Bumping because this is still broken, and is pretty much preventing me from using TypeScript entirely