Gary
Gary
NNuxt
Created by Bazze on 5/29/2024 in #❓・help
Using nuxtjs/i18n types in a module
@Bazze - unfortunately I don't have an answer for you here but I can tell you I have more trouble with this package (and really what it wraps around - the vue i18n) then I know what to do with. I have strugged with issue and after issue with it. I just keep jiggling the handle until I get it to work. I'm interested to see if anyone actually has an answer for you. You're in my prayers sir. 🙂
25 replies
NNuxt
Created by Gary on 5/19/2023 in #❓・help
defineNuxtPlugin is not defined
For future knowledge I ended up addressing this by placing this in the final project's nuxt config:
vite: {
optimizeDeps: {
exclude: [
'#imports',
],
},
}
vite: {
optimizeDeps: {
exclude: [
'#imports',
],
},
}
15 replies
NNuxt
Created by Gary on 5/19/2023 in #❓・help
defineNuxtPlugin is not defined
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
15 replies
NNuxt
Created by Gary on 5/19/2023 in #❓・help
defineNuxtPlugin is not defined
Just want to confirm @fuyu - if auto-imports are disabled I do have to import them from #imports, correct?
15 replies
NNuxt
Created by Gary on 5/19/2023 in #❓・help
defineNuxtPlugin is not defined
But in a few places where I'm doing something like import { useCookie } from '#imports' I'm getting ERROR: Could not resolve "#imports"
15 replies
NNuxt
Created by Gary on 5/19/2023 in #❓・help
defineNuxtPlugin is not defined
AutoImports has been disabled
15 replies
NNuxt
Created by Gary on 5/19/2023 in #❓・help
defineNuxtPlugin is not defined
Thanks @fuyu ! any insight on the application not being able to resolve "#imports"?
15 replies
NNuxt
Created by Gary on 5/19/2023 in #❓・help
defineNuxtPlugin is not defined
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.
15 replies
NNuxt
Created by Gary on 5/19/2023 in #❓・help
defineNuxtPlugin is not defined
Also, it's the same with something like ref - why do I have to import all the things when it's a module?
15 replies
NNuxt
Created by Gary on 5/19/2023 in #❓・help
defineNuxtPlugin is not defined
It appears that you have to do something like:
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
in the plugin sort of like this: https://github.com/nuxt/image/blob/main/src/runtime/plugin.ts
15 replies
NNuxt
Created by Romi on 5/19/2023 in #❓・help
NuxtLink not working, getting console errors
Awesome!
7 replies
NNuxt
Created by Romi on 5/19/2023 in #❓・help
NuxtLink not working, getting console errors
There are a lot of things that could be happening here but its not NuxtLink that's causing it. Can you provide more information: - What mode are you rendering in? - What do the two pages look like in code? - Can you reproduce the error on Stackblitz?
7 replies