question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Nuxt3 Auto-Imports

See original GitHub issue

Nuxt 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:open
  • Created 2 years ago
  • Reactions:6
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
lmiller1990commented, May 20, 2022

For #1 - does Nuxt auto import ref, computed etc? In the post it says

If you’re familiar with <script setup>, the syntactic sugar over the setup function, you can use any of the composable functions that Nuxt 3 brings to you.

What 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.

0reactions
xxSkyycommented, Nov 10, 2022

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found