Skip to content
New issue

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

export typescript types in package.json #50

Merged
merged 1 commit into from
Jul 2, 2024
Merged

export typescript types in package.json #50

merged 1 commit into from
Jul 2, 2024

Conversation

RikSchefferAmsterdam
Copy link
Contributor

When adding this import to a react native project import {ReactNativePlugin} from '@microsoft/applicationinsights-react-native', I get the following error:

Could not find a declaration file for module '@microsoft/applicationinsights-react-native'. '/Users/rik/workspace/aapp_app_mobile/node_modules/@microsoft/applicationinsights-react-native/dist-esm/index.js' implicitly has an 'any' type.
  There are types at '/Users/rik/workspace/aapp_app_mobile/node_modules/@microsoft/applicationinsights-react-native/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@microsoft/applicationinsights-react-native' library may need to update its package.json or typings.ts(7016)

This can easily be solved be changes the package.json exports. So therefore I made this pull requests.

@MSNev MSNev requested a review from siyuniu-ms June 4, 2024 19:50
@siyuniu-ms
Copy link
Contributor

siyuniu-ms commented Jun 4, 2024

https://webpack.js.org/guides/package-exports/#conditions
based on this doc, this syntax is correct.
Test via sample app, works good locally.

@MSNev MSNev added this to the 4.3.0 milestone Jul 2, 2024
@MSNev MSNev merged commit e4d2440 into microsoft:main Jul 2, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants