We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b59206 commit 0281675Copy full SHA for 0281675
1 file changed
packages/app/server/plugins/config.ts
@@ -1,3 +1,16 @@
1
+// This plugin ensures runtime config is properly initialized early in the request lifecycle
2
export default defineNitroPlugin((nitro) => {
- nitro.hooks.hook("request", async () => {});
3
+ nitro.hooks.hook("request", async (event) => {
4
+ try {
5
+ // Pre-load the configuration to ensure it's initialized
6
+ const config = useRuntimeConfig(event);
7
+ // eslint-disable-next-line no-console
8
+ console.log(
9
+ "Runtime config initialized successfully:",
10
+ Object.keys(config),
11
+ );
12
+ } catch (error) {
13
+ console.error("Failed to initialize runtime config:", error);
14
+ }
15
+ });
16
});
0 commit comments