N
Nuxtβ€’4mo ago
Victor Neves

[nuxt] Could not access `nitro`

Has anyone faced similar problem? [nuxt] Could not access nitro. The only available runtime config keys on the client side are public and app. See https://nuxt.com/docs/guide/going-further/runtime-config for more information. To test, I removed the client plugins (even the sever plugins) and also moved all keys into public and still get this warning on the browser console when running dev mode. Any help would be appreciated Thanks
7 Replies
manniL
manniLβ€’4mo ago
@Victor Neves show some code probably you use useRuntimeConfig outside of the nuxt context
Victor Neves
Victor Nevesβ€’4mo ago
It isn't very easy to share code as it's a big project πŸ˜… Let's see if sharing in which kind of files I'm using it if it's possible to get some idea I'm using the useRuntimeConfig on components script setup, composables and server files
Victor Neves
Victor Nevesβ€’4mo ago
It looks like I'm hunting ghosts I made an extreme test removing all useRuntimeConfig (replaced by hardcode values), deleted the .nuxt folder and when running the project in dev mode I still get the warnings
No description
Victor Neves
Victor Nevesβ€’4mo ago
No description
manniL
manniLβ€’4mo ago
It isn't very easy to share code as it's a big project πŸ˜…
An ideal chance to improve your debugging skills and provide a reproduction πŸ˜„
Victor Neves
Victor Nevesβ€’4mo ago
that's what I have been doing a lot while migrating this project πŸ˜… but seriously, this one is insane, I don't have useRuntimeConfig, no custom plugins, only external modules and we even deleted all pages (only left one) and removed the javascript on app.vue and we still get the warning πŸ˜• I found the culprit sidebase/nuxt-auth v0.8 I have downgraded to v0.7.2 and the warning was gone now I need to restore everything to have 100% sure confirmed But it appears to be with a combination of the flow I have Did a test on their repo example upgrading to v0.8 and didn't see the warning Need to continue investigating it to see if I can reproduce it with a mall boilerplate Now I was able to reproduce it using their repo example So it looks like it has to do with something they ship on this last release
Victor Neves
Victor Nevesβ€’4mo ago
Already reported the bug on sidebase And looking into the logs from the update I have the feeling that the warning is caused by this https://github.com/sidebase/nuxt-auth/blob/b2ad71a9d572fb3237a4c5fb32475773437d1c9f/src/runtime/utils/kit.ts#L21
GitHub
nuxt-auth/src/runtime/utils/kit.ts at b2ad71a9d572fb3237a4c5fb32475...
πŸ” Nuxt user authentication and sessions via authjs (next-auth), local and refresh providers. nuxt-auth wraps NextAuth.js to offer the reliability & convenience of a 12k star library to the ...
Want results from more Discord servers?
Add your server