ApplicationInsights-JS icon indicating copy to clipboard operation
ApplicationInsights-JS copied to clipboard

[BUG] Error when initialize ApplicationInsights

Open itsmedardan opened this issue 4 years ago • 1 comments

Description/Screenshot

Getting this error when trying to initialize ApplicationInsights.

Could not find file .../%22./PropertiesPlugin.js Error: Could not find file .../%22./PropertiesPlugin.js at TsTranspiler.resolveFilePath (.../node_modules/@ts-liveserver/ts-transpiler/dist/TsTranspiler.js:69:15)

Steps to Reproduce

  • OS/Browser:
  • SDK Version [e.g. 22]: 2.7.0
  • How you initialized the SDK:
import { ApplicationInsights } from '@microsoft/applicationinsights-web';
/**
 *
 */
export default class PlatformAnalytics {
	private appInsights;

	/**
	 * Constructor.
	 *
	 */
	constructor() {
		const appInsights: ApplicationInsights = new ApplicationInsights({
			config: {
				instrumentationKey: 'INSTRUMENTATION_KEY'
			}
		});
		this.appInsights = appInsights.loadAppInsights();
	}
	/**
	 * @param name
	 * @param url
	 */
	public trackPageView(name: string, url: string): void {
		this.appInsights.trackPageView({
			name: name,
			uri: url
		});
	}
}

Expected behavior

Additional context Add any other context about the problem here.

itsmedardan avatar Oct 28 '21 09:10 itsmedardan

What is your build environment, this error indicates that you don't have all of the dependencies installed. The AISku (which looks like the component you are importing) correctly defines the properties plugin as a dependency https://github.com/microsoft/ApplicationInsights-JS/blob/master/AISKU/package.json#L73

MSNev avatar Oct 28 '21 18:10 MSNev

This Issue will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.

github-actions[bot] avatar Aug 25 '22 07:08 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Sep 26 '23 00:09 github-actions[bot]