csprance / nuxt3-pino

Pino Logger Nuxt3 module
9 stars 1 forks source link

defineNuxtPlugin is not found #2

Open briandee opened 8 months ago

briandee commented 8 months ago

Looking at the Nuxt plugin documentation, plugins are only read if they are defined in the plugins directory. Since the plugins defined in the code are in the runtime folder they will not be scanned. When I install and attempt to use the plugin in a Nuxt 3.10.0 app it fails with the following:

[nuxt] [request error] [unhandled] [500] defineNuxtPlugin is not defined at ./node_modules/nuxt3-pino/dist/runtime/pino.server.mjs:3:1
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ViteNodeRunner.runModule (/Users/g4792/Desktop/care-locationdata-ui/node_modules/vite-node/dist/client.mjs:362:5)
at async ViteNodeRunner.directRequest (/Users/g4792/Desktop/care-locationdata-ui/node_modules/vite-node/dist/client.mjs:346:5)
at async ViteNodeRunner.cachedRequest (/Users/g4792/Desktop/care-locationdata-ui/node_modules/vite-node/dist/client.mjs:189:14)

paambaati commented 2 months ago

@csprance Facing the same issue.

csprance commented 2 months ago

It will be a bit before I can get to this. If you send a PR I'm happy to merge it.