1

我正在尝试让 NativeScript 应用程序将日志写入 Azure AppInsight。我为此使用了 npm 包“@microsoft/applicationinsights-web”(2.5.8)。

在应用程序启动时,我在尝试调用时收到此错误new ApplicationInsights()

System.err: TypeError: Cannot assign to read only property '__extends' of object '[object global]'
System.err: File: (file: node_modules\@microsoft\applicationinsights-shims\dist-esm\applicationinsights-shims.js:96:0)
System.err: 
System.err: StackTrace:
System.err: (file: node_modules\@microsoft\applicationinsights-shims\dist-esm\applicationinsights-shims.js:96:0)
System.err:     at (file: node_modules\@microsoft\applicationinsights-shims\dist-esm\applicationinsights-shims.js:97:1)
System.err:     at ../node_modules/@microsoft/applicationinsights-shims/dist-esm/applicationinsights-shims.js(file:///data/data/com.mycompany.live/files/app/vendor.js:95073:30)     
System.err:     at __webpack_require__(file: src\webpack\bootstrap:753:0)
System.err:     at fn(file: src\webpack\bootstrap:120:0)
System.err:     at ../node_modules/@microsoft/applicationinsights-web/dist-esm/applicationinsights-web.js(file: node_modules\@microsoft\applicationinsights-web\dist-esm\applicationinsights-web.js:1:0)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:753:0)
System.err:     at fn(file: src\webpack\bootstrap:120:0)
System.err:     at ./app/shared/tracking.service.ts(file:///data/data/com.mycompany.live/files/app/bundle.js:1681:92)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:753:0)
System.err:     at fn(file: src\webpack\bootstrap:120:0)
System.err:     at ./app/shared/default-error-handler.service.ts(file:///data/data/com.mycompany.live/files/app/bundle.js:1316:75)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:753:0)
System.err:     at fn(file: src\webpack\bootstrap:120:0)
System.err:     at ./app/shared/index.ts(file:///data/data/com.mycompany.live/files/app/bundle.js:1351:88)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:753:0)
System.err:     at fn(file: src\webpack\bootstrap:120:0)
System.err:     at ./app/app.module.ts(file:///data/data/com.mycompany.live/files/app/bundle.js:214:66)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:753:0)
System.err:     at fn(file: src\webpack\bootstrap:120:0)
System.err:     at (file:///data/data/com.mycompany.live/files/app/bundle.js:2027:73)
System.err:     at ./main.ts(file:///data/data/com.mycompany.live/files/app/bundle.js:2095:30)
System.err:     at __webpack_require__(file: src\webpack\bootstrap:753:0)
System.err:     at checkDeferredModules(file: src\webpack\bootstrap:43:0)
System.err:     at webpackJsonpCallback(file: src\webpack\bootstrap:30:0)
System.err:     at (file:///data/data/com.mycompany.live/files/app/bundle.js:2:57)
System.err:     at require(:1:266)

我想知道是否有人已经找到了解决这个问题的方法。

4

0 回答 0