nuxt / bridge

🌉 Experience Nuxt 3 features on existing Nuxt 2 projects
MIT License
268 stars 28 forks source link

`useRuntimeConfig()` returns `NitroRuntimeConfig` type #1229

Closed evgenii-code closed 3 weeks ago

evgenii-code commented 3 weeks ago

Environment

Reproduction

Create plugin and call useRuntimeConfig composable.

// /plugins/test.ts
export default defineNuxtPlugin(() => {
  const $config = useRuntimeConfig();

  console.log('$config', $config);
});

https://stackblitz.com/edit/nuxt-bridge-starter?file=plugins%2Ftest.ts

Describe the bug

The return type of the useRuntimeConfig composable is NitroRuntimeConfig, but should be RuntimeConfig.

image

I believe this is related to the known bug in Nuxt 3 https://github.com/nuxt/nuxt/pull/25440 https://github.com/nuxt/nuxt/issues/26028

Additional context

No response

Logs

No response