SyntaxError: Cannot use import statement outside a module (Nuxt 3 + heroicons/vue + headlessui/vue)
See original GitHub issueHello ! 👋
Environment
E:\WindowsData\Bureau\portfolio-v3>npx nuxi info
Nuxt CLI v3.0.0-27234417.10170da
RootDir: E:\WindowsData\Bureau\portfolio-v3
Nuxt project info:
------------------------------
- Operating System: `Windows_NT`
- Node Version: `v16.6.1`
- Nuxt Version: `3-3.0.0-27234417.10170da`
- Package Manager: `Yarn`
- Bundler: `Webpack`
- User Config: `ssr`, `srcDir`, `plugins`
- Runtime Modules: `-`
- Build Modules: `-`
------------------------------
Describe the bug and expected behavior
I have tried to integrate a component from Tailwindui which exploits the disclosure component.
(so I have the same problem with the icons of heroicons)
Steps to reproduce
Juste clone this repository
Then install all dependancies and execute yarn dev
Issue Analytics
- State:
- Created 2 years ago
- Reactions:11
- Comments:10 (2 by maintainers)
Top Results From Across the Web
HeadlessUI is not working with Nuxt 3 · Issue #982 - GitHub
@headlessui/vue What version of that package are you using? ... SyntaxError: Cannot use import statement outside a module at Object.
Read more >How to run @headlessui/vue in Nuxt 3 project? - Stack Overflow
I'm able to see the package in node_modules folder. But I keep getting below error. Internal server error: Failed to resolve import "@headlessui ......
Read more >Add a headless CMS to Nuxt 3 in 5 minutes - Storyblok
In this quick walkthrough, we will have a look at how we can use data from the Storyblok API with a Nuxt project...
Read more >Is Nuxt.js Content The Next Big Headless CMS ... - YouTube
js Auto- Import Tutorial - YouTube ...
Read more >Headless CMS, Nuxt, and Vue.js! (with Lucie Haberer)
Join us to learn more about all things headless, Nuxt, and Vue.js from Lucie Haberer, Dev Experience Engineer @ Prismic.
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
I have also notice that error, when trying to integrate headless ui to Nuxt 3.
I have the same error:
In short, you can add this to your
nuxt.config.ts
to use headlessui with nuxt3.Unfortunately there still needs some work in the @headlessui/vue package so that Prerendering/SSR doesn’t fail. In my case