useAppConfig() not exposed to <script setup> in app.vue
I created a plugin
/app/plugins/fetchAppSettings.server.ts
that fetches my app's settings from the database.
This seems to work fine , console.log(useAppConfig().appSettings)
logs the settings correctly.
Now, I want to use these settings in my app.vue
script setup:
This console.log(appSettings)
logs the settings correctly server-side but client-side, I just receive an emtpy object.
In my nuxt.config.ts
, I registered the app settings:
and I created a app.config.ts
file and registered the appSettings there:
What am I missing here? Why aren't the appSettings passed to the client correctly? Help would be much appreciated.0 Replies