Intevel / nuxt-directus

🐰 Easily integrate Directus to your Nuxt application.
https://nuxt-directus.de/
MIT License
268 stars 49 forks source link

[nuxt] [request error] nuxt instance unavailable - from composables/news.vue #43

Closed hermesalvesbr closed 2 years ago

hermesalvesbr commented 2 years ago
npx nuxi info
Nuxt CLI v3.0.0-rc.4-27588443.cf25525                                 20:02:49
RootDir: /home/hermes/projetos/nuxt/araripina           20:02:50
Nuxt project info:                                                    20:02:50

------------------------------
- Operating System: `Linux`
- Node Version:     `v16.14.2`
- Nuxt Version:     `3.0.0-rc.4-27588443.cf25525`
- Package Manager:  `yarn@3.2.0`
- Builder:          `vite`
- User Config:      `modules`, `directus`, `head`, `build`, `publicRuntimeConfig`
- Runtime Modules:  `@nuxtjs/tailwindcss@5.1.2`, `nuxt-directus@2.1.0`
- Build Modules:    `-`
------------------------------

I'm using the nuxt-directus module inside composables file, like this: const { getItemById } = useDirectusItems()

Show me this error:

[nuxt] [request error] nuxt instance unavailable
  at Module.useNuxtApp (./.nuxt/dist/server/server.mjs:458:13)  
  at Module.useDirectus (./.nuxt/dist/server/server.mjs:7541:38)  
  at Module.useDirectusItems (./.nuxt/dist/server/server.mjs:7449:42)  
  at $id_caa1d2fd (./.nuxt/dist/server/server.mjs:7410:47)  
  at async __instantiateModule__ (./.nuxt/dist/server/server.mjs:14298:3)

I cant to use this module inside composable/news.vue ? However, may i to use just inside Githubissues.

  • Githubissues is a development platform for aggregating issues.