TypeScript: module '...lru-cache' has no default export
See original GitHub issueHello, as of today, with the latest version of both axios extensions and lru-cache, I get the following error while compiling with typescript:
ERROR in /.../node_modules/axios-extensions/lib/index.d.ts(6,8):
TS1192: Module '"/.../node_modules/@types/lru-cache/index"' has no default export.
Version: typescript 2.9.2
And it indeed is true; I had to change line
import Cache from 'lru-cache';
to
import {Cache} from 'lru-cache';
And it compiles succesfully.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Typescript - TS1192: Module has no default export
I do not know why but every time I compile code with npm it shows me this: TS1192: Module '"/home/admin/Desktop/projects/myProj/frontend/components/SectionTitle ...
Read more >TypeScript errors and how to fix them
Below you find a list of common TypeScript errors along with the buggy code ... error TS1192: Module ' json5 ' has no...
Read more >TSConfig Option: allowSyntheticDefaultImports - TypeScript
This option brings the behavior of TypeScript in-line with Babel, where extra code is emitted to make using a default export of a...
Read more >type 'typeof import has no call signatures - You.com | The search ...
You need to import the default export from express instead of the namespace (which is an object with all named exports). In your...
Read more >npm:typescript-lru-cache | Skypack
If not passed, JSON.parse(JSON.stringify(value)) is used for cloning objects. Example using options: import { LRUCache } from 'typescript-lru-cache'; ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for your feedback!
Yes,
"allowSyntheticDefaultImports": true
does fix the issue. Thank you!