Description/Screenshot
@microsoft/applicationinsights-web breaks running the local development Angular server after upgrading to Angular 20.3.* packages with error Cannot redefine property: name. Prevents anything from working/running.
Uncaught TypeError: Cannot redefine property: name
at defineProperty (<anonymous>)
at __name (chunk-TJFVSI2U.js:20:33)
at AnalyticsPlugin.js:57:10
Steps to Reproduce
Create a brand new Angular 20 application w/ modules (using angular cli global version 20.3.1)
ng new cannot-redefine-property --standalone=false --ai-config "none" --style "scss" --ssr false --zoneless false
Install ApplicationInsights-JS
npm i @microsoft/applicationinsights-web
Add Application Insights creation to the app.ts constructor
protected readonly appInsights: ApplicationInsights;
constructor() {
this.appInsights = new ApplicationInsights({
config: {
instrumentationKey: '<InstrumentationKeyHere>'
}
});
}
Then run the dev server and viewing the browser dev tool console you will see the error.
-
npm start
-
OS/Browser: Windows, Chrome and Edge
-
SDK Version [e.g. 22]: 3.3.9
-
How you initialized the SDK:
this.appInsights = new ApplicationInsights({
config: {
instrumentationKey: '<InstrumentationKeyHere>'
}
});
Expected behavior
Error should not occur and the site should run and display.
Additional context
This issue only started occurring when upgrading from Angular 20.2.* versions to 20.3.* in order to resolve dependency vulnerabilities.
Example repo: Angular20.3WithAppInsights
Description/Screenshot
@microsoft/applicationinsights-webbreaks running the local development Angular server after upgrading to Angular 20.3.* packages with errorCannot redefine property: name. Prevents anything from working/running.Steps to Reproduce
Create a brand new Angular 20 application w/ modules (using angular cli global version 20.3.1)
ng new cannot-redefine-property --standalone=false --ai-config "none" --style "scss" --ssr false --zoneless falseInstall ApplicationInsights-JS
npm i @microsoft/applicationinsights-webAdd Application Insights creation to the app.ts constructor
Then run the dev server and viewing the browser dev tool console you will see the error.
npm startOS/Browser: Windows, Chrome and Edge
SDK Version [e.g. 22]: 3.3.9
How you initialized the SDK:
Expected behavior
Error should not occur and the site should run and display.
Additional context
This issue only started occurring when upgrading from Angular 20.2.* versions to 20.3.* in order to resolve dependency vulnerabilities.
Example repo: Angular20.3WithAppInsights