NuxtN
Nuxt8mo ago
8 replies
dmarr

Extending public runtime config type

I have a featureFlags property on my runtimeConfig.public config. However, when I try to do something like:
const { featureFlags: runtimeFeatureFlags = '' } = useRuntimeConfig().public;
const featureFlags = ref(runtimeFeatureFlags.split(','));

The featureFlags property type is unknown.
I tried adding this to <srcDir>/index.d.ts:
declare module 'nuxt/schema' {
  interface PublicRuntimeConfig {
    featureFlags: string;
  }
}
export {};

Still same error. I am an app extending from a layer if that makes any difference. Where am I going wrong here?
Was this page helpful?