We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As per documentation, the way to import the MemoryCache class is
MemoryCache
import { MemoryCache } from 'memory-cache-node';
which doesn't work because MemoryCache is exported as default - as per MemoryCache.d.ts:
default
MemoryCache.d.ts
export default class MemoryCache<K, V>
and the above import statement gives SyntaxError: The requested module 'memory-cache-node' does not provide an export named 'MemoryCache' error.
SyntaxError: The requested module 'memory-cache-node' does not provide an export named 'MemoryCache'
So the import that actually works is
import MemoryCache from 'memory-cache-node';
But then you gotta use it like
const cache = new MemoryCache.MemoryCache<string, number>(30, 50000);
otherwise you get TypeError: object is not a constructor.
TypeError: object is not a constructor
I'm using es6 modules, if it's relevant.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
As per documentation, the way to import the
MemoryCache
class iswhich doesn't work because MemoryCache is exported as
default
- as perMemoryCache.d.ts
:and the above import statement gives
SyntaxError: The requested module 'memory-cache-node' does not provide an export named 'MemoryCache'
error.So the import that actually works is
But then you gotta use it like
otherwise you get
TypeError: object is not a constructor
.I'm using es6 modules, if it's relevant.
The text was updated successfully, but these errors were encountered: