[Bug]: ReferenceError: window is not defined
See original GitHub issueWhat package within Headless UI are you using?
What version of that package are you using?
1.4.1
What browser are you using?
Chrome
Reproduction repository
https://github.com/productdevbook/nuxt3-app/tree/dev
Describe your issue
yarn build yarn start localhost:3000 click menus, and take a look around the site
Logs
[Vue warn]: Component Menu is missing template or render function.
ReferenceError: window is not defined
[Vue warn]: Component Menu is missing template or render function.
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: onMounted is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.
[Vue warn]: onUnmounted is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.
[Vue warn]: onMounted is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.
[Vue warn]: provide() can only be used inside setup().
[Vue warn]: provide() can only be used inside setup().
[Vue warn]: inject() can only be used inside setup() or functional components.
[Vue warn]: inject() can only be used inside setup() or functional components.
TypeError: Cannot read property 'show' of undefined
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
referenceerror: window is not defined, how to solve
Here's how to fix the “referenceerror: window is not defined” error that you might have in Node.js or with a tool like Next.js....
Read more >How To Solve ReferenceError window is not defined in ...
Fixing a window is not defined error can be quite simple. In most cases, all you will need to do is wrap your...
Read more >How to solve "window is not defined" errors in React and Next.js
1. First solution: typeof · 2. Second solution: the useEffect hook · 3. Third solution: dynamic loading.
Read more >[Solved] ReferenceError : window is not defined - ItsJavaScript
The ReferenceError : window is not defined error mainly occurs if you are using the window object in Node.js, React.js, Next.js.
Read more >How to solve Next.js window is not defined
ReferenceError : window is not defined is a pretty common error you may run into when using Next.js for the first time but...
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 Free
Top 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
This should be fixed (#867), and will be available in the next release. You can already try it using
npm install @headlessui/vue@dev
oryarn add @headlessui/vue@dev
.I didn’t have time to look into that one yet, but we do have ESM builds as well, which is also configured in the package.json. Don’t want to jump to conclusions here, but maybe Nuxt is not resolving the correct file to use.
E.g.: https://unpkg.com/browse/@headlessui/vue@1.4.1/dist/headlessui.esm.js There is also no
require
defined in that file, so should be fine.