Closed tmladek closed 6 years ago
have you ever enable the ts config esModuleInterop: true
?
When I try to import Cache from 'lru-cache'
, enabling esModuleInterop
fixes the issue; however, when I am not importing it directly, and only, for example import {cacheAdapterEnhancer} from 'axios-extensions'
, it doesn't matter what esModuleInterop
is set to, I get the error.
Minimal example here: https://gist.github.com/tmladek/2b25461159d60fe4568de85b071b73a3
sorry, forgotten with the config "allowSyntheticDefaultImports": true,
..
I will make a bit change for the unnecessary implicit configuration.
Yes, "allowSyntheticDefaultImports": true
does fix the issue. Thank you!
Thanks for your feedback!
I had tried with esModuleInterop: true
and not the other value, will try now. Thanks hugely for the help guys and the quick response. Hopefully this is all good.
Hello, as of today, with the latest version of both axios extensions and lru-cache, I get the following error while compiling with typescript:
And it indeed is true; I had to change line
import Cache from 'lru-cache';
toimport {Cache} from 'lru-cache';
And it compiles succesfully.