Support Nuxt3 Auto-Imports
See original GitHub issueNuxt 3 provides auto import for script-setup for composable functions (not only)
Info about: https://www.storyblok.com/mp/nuxt3-best-features
Example: https://codesandbox.io/s/dazzling-butterfly-7eo67
It’d be great to support it, for now it throws errors like ReferenceError: ref is not defined
if you won’t import it manually
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Auto imports · Nuxt Concepts
Nuxt auto-imports helper functions, composables and Vue APIs to use across your application without explicitly importing them.
Read more >Nuxt.js 3: don't suggest to auto-import functions exposed in ...
Function is unrecognized and webstorm will suggest a manual import. Same issues appear with most Vue 3 functions that are handled by Nuxt...
Read more >Components auto imports in Nuxt 3 with modules
The answer was to make the same as in nuxt.config.ts : from https://stackoverflow.com/a/66336654/10805872.
Read more >Importing and Using Components in Nuxt 3
When migrating from Nuxt 2 to Nuxt 3, components are now imported and used through auto imports instead of explicit importing.
Read more >Nuxt 3 components auto-import
This sandbox demonstrates how Vue components are auto-imported in a Nuxt application. 0.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For #1 - does Nuxt auto import
ref
,computed
etc? In the post it saysWhat does it refer to when it says “any of the composable functions that Nuxt 3 brings to you”? I thought this means things inside of
composables
- not raw Vue reactivity APIs (could be wrong, I haven’t used Nuxt 3 much).I looked at your example #2 link - looks like a regular Nuxt starter? What should I be seeing?
Either way, any form of Nuxt magic is going to be a problem. We might need to sync with the Nuxt team - I don’t think Test Utils should attempt to replicate Nuxt, rather, we should find out what they are doing to register things and see if we can hook into it, so we can get any changes they make for free.
@speg I didn’t test it with cypress so I’m not sure. Blind guess - maybe update your vite. Here you have my example configured repo with nuxt3 and vitest working https://gitlab.com/xxSkyy/nuxt3-vitest-example