Skip to content

[BUG] ClickAnalytics throwing errors in console #2075

@cadriel

Description

@cadriel

Having installed the latest applicationinsights-web and applicationinsights-clickanalytics-js packages, errors are occurring in the console.

Screenshot 2023-05-15 at 2 30 10 PM

caught TypeError: Cannot read properties of undefined (reading 'core')

Packages and versions installed are;

    "@microsoft/applicationinsights-clickanalytics-js": "^3.0.1",
    "@microsoft/applicationinsights-web": "^3.0.1",

And a snippet of how I'm installing is;

export const appInsightsPlugin = {
  install: (app: App, opts: AppInsightsOptions) => {
    const clickPluginInstance = new ClickAnalyticsPlugin()
    const clickPluginConfig = {
      autoCapture: true
    }

    const appInsightsConfig = {
      ...opts.config,
      extensions: [clickPluginInstance],
      extensionConfig: {
        [clickPluginInstance.identifier]: clickPluginConfig
      }
    }

    const appInsights = new ApplicationInsights({
      config: appInsightsConfig
    })

    appInsights.loadAppInsights()
    appInsightsPlugin.setupPageTracking(opts, app)
...

This is a Vue3 project - and Application Insights seems to run ok when loading without the Click Plugin.

If this is a mis-configuration - I'd expect an error indicating so, or something else to go on. :)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions