Skip to content

Commit

Permalink
add in root (#2395)
Browse files Browse the repository at this point in the history
  • Loading branch information
siyuniu-ms authored Sep 20, 2024
1 parent a3a2cd4 commit 883fee6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ This version comes with the bare minimum amount of features and functionalities
| [React](https://github.com/microsoft/applicationinsights-react-js) | [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-react-js.svg)](https://www.npmjs.com/package/@microsoft/applicationinsights-react-js)
| [React Native](https://github.com/microsoft/applicationinsights-react-native) | [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-react-native.svg)](https://www.npmjs.com/package/@microsoft/applicationinsights-react-native)
Click here for a [Type Error Fixed Guideline](https://microsoft.github.io/ApplicationInsights-JS/ExtensionErrorSteps)
## Build a new extension for the SDK
The SDK supports the ability to include multiple extensions at runtime. In order to create a new extension, please implement the following interface:
Expand Down
38 changes: 38 additions & 0 deletions docs/ExtensionErrorSteps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Investigating and Solving Plugin-Type Errors in Extensions

This guide addresses plugin-type errors encountered when using the `applicationinsights-web` package alongside other extensions, such as `@microsoft/applicationinsights-react-js`, `@microsoft/applicationinsights-react-native`, and `@microsoft/applicationinsights-angularplugin-js`.

## Overview

A common error message associated with these issues might look like this:

```plaintext
Type 'ReactPlugin' is not assignable to type 'ITelemetryPlugin'.
```

Plugin-type errors often arise due to version mismatches between applicationinsights-web and its extensions.

## Reason

When a new version of applicationinsights-web (which includes applicationinsights-core as a dependency) is released, package management tools may automatically update applicationinsights-core to the new version. However, if the extensions (e.g., React, Angular) have not been updated, their dependencies on applicationinsights-core may not match, leading to type errors.

## Steps to Investigate and Solve Plugin-Type Errors

### 1. Verify Package Versions

- **Check Dependencies**: Ensure that you have compatible versions of applicationinsights-common, applicationinsights-core, and any other related libraries. Look for discrepancies in your yarn.lock or package-lock.json or node_modules folder.
![alt text](./media/pluginType.png)

### 2. Perform a Complete Update
The easiest way to ensure all dependencies are updated is to delete the node_modules folder and reinstall the packages:
```
rm -rf node_modules
npm install
```
### 3. Examples to follow
Here is a discussion that provide deeper insights into resolving these issues:
https://github.com/microsoft/applicationinsights-react-js/issues/95




Binary file added docs/media/pluginType.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 883fee6

Please sign in to comment.