question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript: module '...lru-cache' has no default export

See original GitHub issue

Hello, 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:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kuitoscommented, Jul 31, 2018

Thanks for your feedback!

0reactions
tmladekcommented, Jul 31, 2018

Yes, "allowSyntheticDefaultImports": true does fix the issue. Thank you!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found