Skip to content

Type 'AngularPlugin' is not assignable to type 'ITelemetryPlugin', Angular 15 ( "@angular/common": "15.1.0") error when trying to build the project #97

@hladysh

Description

@hladysh

error TS2322: Type 'AngularPlugin' is not assignable to type 'ITelemetryPlugin'.
Types of property 'setNextPlugin' are incompatible.

import { AngularPlugin } from '@microsoft/applicationinsights-angularplugin-js';

    const angularPlugin = new AngularPlugin();
    this.appInsights = new ApplicationInsights({
        config: {
            instrumentationKey: 'key',
            enableAutoRouteTracking: false, // option to log all route changes
            enableCorsCorrelation: true,
            extensions: [angularPlugin],
            extensionConfig: {
                [angularPlugin.identifier]: { router: this.router },
            },
        },
    });
    this.appInsights.loadAppInsights();

extensions: [angularPlugin],
                            ~~~~~~~~~~~~~

"@microsoft/applicationinsights-angularplugin-js": "3.0.1",
"@microsoft/applicationinsights-web": "2.8.9",
"@angular/common": "15.1.0",
"typescript": "4.9.4",

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions