You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which also does not work and it leads to this error:
🆕 The solution you'd like
Add Nuxt aliases or something similar so the developer can easily import composable or components explicitly.
Example:
// re-export everything through the root index barrel fileimport{useScriptGoogleTagManager}from'@nuxt/scripts// re-export just for certain folder index barrel fileimport { useScriptGoogleTagManager } from '@nuxt/scripts/registry// or avoid using barrel files due to performance issues and use at least Nuxt alias and directly import fileimportuseScriptGoogleTagManagerfrom '@nuxt/scripts/registry/google-tag-manager.ts
🔍 Alternatives you've considered
No response
ℹ️ Additional info
No response
The text was updated successfully, but these errors were encountered:
Hi, I believe the correct usage here is to just import explicitly from #imports
import { useScriptGoogleTagManager } from '#imports'
I'm open to adding a domain-specific alias for the registry scripts as I'm already using a few, but would need a valid use case.
#nuxt-scripts -> types
#nuxt-scripts-utils -> utils
#nuxt-scripts-validator -> valibot or mock
When you import it from #imports it imports the wrong one 🙈 .
Other than that, there are multiple issues in general with #imports (e.g go to definition etc) so there are a lot reasons why it would be good improve imports and add aliases as you suggested. @harlan-zw
🆒 Your use case
If
Nuxt
project hasautoImports
turned off, when you want to import some composable from nuxt/scripts you need to do something like this:Which also does not work and it leads to this error:
🆕 The solution you'd like
Add Nuxt
aliases
or something similar so the developer can easily import composable or components explicitly.Example:
🔍 Alternatives you've considered
No response
ℹ️ Additional info
No response
The text was updated successfully, but these errors were encountered: