This project was generated using Angular CLI version 20.3.1 using the following command:
ng new my-angular-appThe application runs successfully at this point.
Next, the Application Insights packages were added:
npm i --save @microsoft/applicationinsights-web
npm install @microsoft/applicationinsights-angularplugin-jsAnd finally, the App component was updated
per the Add the extension to your code
instructions; see the app.ts file.
Running the application now results in the following error:
TypeError: Cannot redefine property: name
at defineProperty (<anonymous>)
at __name (D:\Angular20WithAppInsights\my-angular-app\.angular\cache\20.3.1\my-angular-app\vite\deps_ssr\chunk-N7BXG4DH.js:30:33)
at eval (D:\Angular20WithAppInsights\my-angular-app\.angular\cache\20.3.1\my-angular-app\vite\deps_ssr\@microsoft_applicationinsights-web.js:861:7)
at async ESModulesEvaluator.runInlinedModule (file:///D:/Angular20WithAppInsights/my-angular-app/node_modules/vite/dist/node/module-runner.js:910:3)
at async SSRCompatModuleRunner.directRequest (file:///D:/Angular20WithAppInsights/my-angular-app/node_modules/vite/dist/node/module-runner.js:1119:59)
at async SSRCompatModuleRunner.directRequest (file:///D:/Angular20WithAppInsights/my-angular-app/node_modules/vite/dist/node/chunks/dep-M_KD0XSK.js:18863:22)
at async SSRCompatModuleRunner.cachedRequest (file:///D:/Angular20WithAppInsights/my-angular-app/node_modules/vite/dist/node/module-runner.js:1037:73)NOTE: The application fails even when the YOUR_CONNECTION_STRING_GOES_HERE text is replaced with a valid AI connection string.
This repo was created to report the issue to Microsoft.