huang-julien / nuxt-applicationinsights

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

Instrumentation key error #72

Closed daveve80 closed 1 week ago

daveve80 commented 2 weeks ago

I keep getting the following error:

nuxt.js:94 [nuxt] error caught during app initialization 
Error: Please provide instrumentation key

I tried to add it as in @nuxtjs/applicationinsights (Nuxt2), but this seems to be ignored.

appInsights: {
    instrumentationKey: '' 
  }

I also tried to add it to the runtimeConfig

applicationinsights: {
        connectionString: ''
 }

Or add the env variables:

APPLICATIONINSIGHTS_CONNECTION_STRING= '' 
APPINSIGHTS_INSTRUMENTATION_KEY= ''
APPINSIGHTS_CONNECTION_STRING= ''

I couldn't find anything in the readme or in the files itself. Probably not a bug / error, but I can't figure out what to do.

huang-julien commented 2 weeks ago

Hello :wave: thanks for the issue !

It's indeed a bug, in the meantime you can use runtimeConfig.applicationinsights.connectionString and runtimeConfig.public.applicationinsights.connectionString to add your connection string