-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with classic Vue Router: ReferenceError: window is not defined #122
Comments
Thank you so much, for your god speed answer and fix. But I do not know, what to do with the information. Still getting the same error. Could you please elaborate a bit, if you have time? Thanks in advance |
ebisbe unfortunately not. But I hope, that if @antfu finds some time, maybe has an idea. |
The router is created by You cannot create your onw router, you can only provide its configuration. To configure the router, you can provide the router options on your You can access the router on the |
You cannot add logic referencing You can see this entry: #21 => #21 (comment) |
@sdoerger the error is not with this package but with Tailwind tailwindlabs/headlessui#840 @userquin Yeah. The issue is with another package not with this one. Everything is working for me now. |
@ebisbe I knew what Userquin said about not having 'window' on Node.js environment because I have experienced issues before with that. As the issue came from the tailwind package I assumed the error was from there so I just search in the issues repository.
Upgrade "@headlessui/vue" to "^1.4.2" and it should not show that error. If you are using '@vueuse/head' with Node 14.x then you need to check vueuse/head#34 as you will encounter another issue. If you use a new Node version it should be working fine then |
|
I am a big fan of vue-ssg and vitesse, but unfortunately I can not get vue-ssg running just with vue 3 and vue-router (and ts, tailwind, pinia in vite).
I saw other solutions here and tried them, but they did not work.
Probably they are wrong applied.
I. e.: #21 (comment) , if I try to import the router like that, I can not use it at all ...
Sorry if repeated, but with current solutions I am not able to make it work for my case ...
main.js
src/router/index.ts
Complete error log
The text was updated successfully, but these errors were encountered: