diff --git a/packages/app/server/plugins/config.ts b/packages/app/server/plugins/config.ts new file mode 100644 index 00000000..dd2d7621 --- /dev/null +++ b/packages/app/server/plugins/config.ts @@ -0,0 +1,16 @@ +// This plugin ensures runtime config is properly initialized early in the request lifecycle +export default defineNitroPlugin((nitro) => { + nitro.hooks.hook("request", async (event) => { + try { + // Pre-load the configuration to ensure it's initialized + const config = useRuntimeConfig(event); + // eslint-disable-next-line no-console + console.log( + "Runtime config initialized successfully:", + Object.keys(config), + ); + } catch (error) { + console.error("Failed to initialize runtime config:", error); + } + }); +});