launchdarkly / react-client-sdk

LaunchDarkly Client-side SDK for React.js
Other
79 stars 67 forks source link

Fix TypeScript warning #148

Closed wojtekmaj closed 1 year ago

wojtekmaj commented 1 year ago

Requirements

Related issues

146, since this error pops up when compiling react-client-sdk with newest TypeScript

Describe the solution you've provided

Fixes TypeScript warning:

WARNING in …

Should not import the named export 'version' (imported as 'version') from default-exporting module (only default export is available soon)

Describe alternatives you've considered

Manually applying patch on our repository; doesn't seem like a sustainable idea.

jacobScottAllen commented 1 year ago

I am unable to reproduce the error, but this does look like the preferred way to import in this case. I'd like to get @yusinto 's opinion as well.

Regardless, can you update the branch with main? I believe that should fix the failing circle-ci issue.

wojtekmaj commented 1 year ago

I got you :) Updated.

wojtekmaj commented 1 year ago

Turns out something is still wrong.

WARNING in ../node_modules/launchdarkly-react-client-sdk/src/initLDClient.ts 8:18-37
Should not import the named export 'version' (imported as 'packageInfo') from default-exporting module (only default export is available soon)

Looks like import * as packageInfo … produces the warning while import packageInfo … does not.