huang-julien / nuxt-applicationinsights

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

Breaks Nuxt RuntimeConfig type #55

Closed ThibaultVlacich closed 1 month ago

ThibaultVlacich commented 1 month ago

When nuxt-applicationinsights is installed, running nuxi typecheck will raise errors that the output of useRuntimeConfig() is unknown

Very easy to create a reproduction: just create a new Nuxt 3 project, and add this:

nuxt.config.ts:

  runtimeConfig: {
    public: {
      test: "",
    },
  },

app.vue:

<script setup lang="ts">
const config = useRuntimeConfig()

const test: string = config.public.test
</script>

This raises no error, but as soon as modules: ["nuxt-applicationinsights"], is added to nuxt.config.ts, an error appears saying that Type 'unknown' is not assignable to type 'string'.