defineNuxtPlugin is not defined
Why would a module I write that uses "addPlugin" cause this issue?
It works fine in the development mode in the playground but bombs when I implement it as a package.
8 Replies
It appears that you have to do something like:
in the plugin sort of like this: https://github.com/nuxt/image/blob/main/src/runtime/plugin.ts
GitHub
image/plugin.ts at main · nuxt/image
Plug-and-play image optimization for Nuxt applications. - image/plugin.ts at main · nuxt/image
Also, it's the same with something like
ref
- why do I have to import all the things when it's a module?Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Thanks so much @unai - You were totally right on. I found the note in the docs after posting here - not sure how I missed that. Thanks again for clearing that up.
I am now getting a really odd error on the application implementing my code:
ERROR: Could not resolve "#imports"
It gripes about this in three composables. I've tripled checked and I don't think they are being used outside of a setup function.
Thanks @fuyu ! any insight on the application not being able to resolve "#imports"?Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
AutoImports has been disabled
But in a few places where I'm doing something like
import { useCookie } from '#imports'
I'm getting ERROR: Could not resolve "#imports"
Just want to confirm @fuyu - if auto-imports are disabled I do have to import them from #imports, correct?Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Gotcha - yeah, it seems that the module starter kit automatically disables autoimport b/c it's inefficent to have it on for things that are in the node_modules directory (cause thats where it ends up) and that makes sense to me. This error... man... no sense
For future knowledge I ended up addressing this by placing this in the final project's nuxt config: