NuxtN
Nuxt12mo ago
envizar

Can't access values from useRuntimeConfig() from /plugins

Can't access values from useRuntimeConfig() from /plugins
runtimeConfig: {
    LOADED_MESSAGE: process.env.LOADED_MESSAGE,
}


And I can't access it from useRuntimeConfig().LOADED_MESSAGE from /plugins/plugin.ts:

export default defineNitroPlugin(() => {
    const config = useRuntimeConfig()

    // logs nothing
    console.log(config.LOADED_MESSAGE)
}
Was this page helpful?