huang-julien / nuxt-applicationinsights

ApplicationInsights module for Nuxt 3.
15 stars 0 forks source link

Initialization failure of AppInsights with RuntimeConfig #68

Closed julien1619 closed 3 weeks ago

julien1619 commented 3 weeks ago

With the last version, if you provide a connection string to the module, Application Insights will fail to initialize.

Capture d’écran 2024-06-07 à 15 22 03

The config provided to AppInsights is a Proxy and not a raw object, and AppInsights tries to set its own observer on the object and it fails. One way to fix it would be to use toRaw:

config: toRaw(runtimeConfig.public).applicationinsights ?? {}
huang-julien commented 3 weeks ago

damn, i probably forgot to add it back while refactoring. Thanks for the issue !