N
Nuxtβ€’4mo ago
bnason

useLogger from `@nuxt/kit` on server side

I'm trying to use useLogger from @nuxt/kit in a server side util, but I get the following:
This module cannot be importedd in server runtime. [importing @nuxt/kit from server/utils/oracle.ts]

RollupError: server/utils/oracle.ts (6:0): "useLogger" is not exported by "node_modules/unenv/runtime/mock/proxy.mjs", "imported by "server/utils/oracle.ts"
This module cannot be importedd in server runtime. [importing @nuxt/kit from server/utils/oracle.ts]

RollupError: server/utils/oracle.ts (6:0): "useLogger" is not exported by "node_modules/unenv/runtime/mock/proxy.mjs", "imported by "server/utils/oracle.ts"
Is it ONLY available in a nuxt module? Thats what the docs show as its usage. Is the setup of a nuxt module not done server side?
5 Replies
bnason
bnasonOPβ€’4mo ago
I guess thaat it only being available for modules make sense since that is what nuxt kit is for
danielroe
danielroeβ€’4mo ago
exactly πŸ‘
bnason
bnasonOPβ€’4mo ago
I wish nuxt had a more unified logging solution, especially for server side logs. I eventually want to start shipping them into our ELK stack.
danielroe
danielroeβ€’4mo ago
absolutely agree. I think @Julien is looking into it.
Julien
Julienβ€’4mo ago
I'm not but i can πŸ‘
Want results from more Discord servers?
Add your server