Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Conversation

@duro
Copy link
Contributor

@duro duro commented Aug 16, 2019

The current TypeScript definitions throw type errors when the package is imported.

When imported as such:

import DynamoDBFeatureStore from 'launchdarkly-node-server-sdk-dynamodb'

The following type error is emitted from the compiler:

Cannot invoke an expression whose type lacks a call signature. Type 'typeof import("launchdarkly-node-server-sdk-dynamodb")' has no compatible call signatures.

This is because the default import has not been properly tagged, and so typescript thinks that DynamoDBFeatureStore is a named import and wants you to import like so:

import { DynamoDBFeatureStore } from 'launchdarkly-node-server-sdk-dynamodb'

But then at run time, this throws an error because that named import does not actually exist.

This PR correctly tags the function as a default export.

Fixes #10

@eli-darkly eli-darkly merged commit e0a5b05 into launchdarkly:master Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typescript definitions are wrong

2 participants