These two imports don't resolve because the files dist/runtime/app/plugins/session.client.d.ts and dist/runtime/app/plugins/session.server.d.ts are empty. This breaks the typing of other plugins that provide a helper on the NuxtApp instance, such as trpc-nuxt:
const { $trpc } = useNuxtApp() // '$trpc' is of type 'unknown'
Using export default {} in the session.client.d.ts and session.server.d.ts files solves the issue.
When using the
nuxt-auth-utils
module and starting Nuxt, two imports are generated in the.nuxt/types/plugins.d.ts
file:These two imports don't resolve because the files
dist/runtime/app/plugins/session.client.d.ts
anddist/runtime/app/plugins/session.server.d.ts
are empty. This breaks the typing of other plugins that provide a helper on the NuxtApp instance, such astrpc-nuxt
:Using
export default {}
in thesession.client.d.ts
andsession.server.d.ts
files solves the issue.