Closed andrew-w-ross closed 1 year ago
Thank you for reporting this issue. We are investigating this and will provide an update soon. Filed internally as 209707.
@yusinto Interestingly, I'm not seeing that 3.0.8 fixes this. I have the following references in my code from 3.0.6 which do not resolve in 3.0.8:
import context from 'launchdarkly-react-client-sdk/lib/context';
import { Provider } from 'launchdarkly-react-client-sdk/lib/context';
Instead, I get the following error: Cannot find module 'launchdarkly-react-client-sdk/lib/context' or its corresponding type declarations.
@yusinto Thanks that worked.
@mellis481 I don't think that was ever intended to work there is only the single export so nothing other than importing from launchdarkly-react-client-sdk
will resolve. Can you not use LDProvider
that's exported?
This is still an issue with 3.0.10
Is this a support request? No
Describe the bug
In 3.0.7 I get the following error when trying to compile under module resolution
bundler
.In 3.0.6 your
package.json
only the main and type properties are defined:In 3.0.7 you've change added the exports field:
As the error explains you need to add the types to exports:
After changing this it'll compile just fine.
To reproduce
I haven't made a simple replication project but I assume trying to import the package with moduleResolution of
node16
,nodenext
orbundler
would do the trick.Expected behavior For the types to be found.
Logs NA
SDK version NA
Language version, developer tools
typescript@5.1.6
OS/platform NA
Additional context NA