Skip to content
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

i am using nuxt and i'm getting this window is not defined #12

Open
Johnnyevans32 opened this issue Jan 8, 2022 · 3 comments
Open

i am using nuxt and i'm getting this window is not defined #12

Johnnyevans32 opened this issue Jan 8, 2022 · 3 comments

Comments

@Johnnyevans32
Copy link

Johnnyevans32 commented Jan 8, 2022

`


>  ERROR  [Vue warn]: Error in created hook: "ReferenceError: window is not defined"

found in

---> <Web3ModalVue> at node_modules/web3modal-vue/src/Web3ModalVue.vue
       <VsNavbar>
         <NavBar> at components/NavBar.vue
           <HomePage> at pages/index.vue
             <Nuxt>
               <DefaultLayout> at layouts/default.vue
                 <Root>

`

@Johnnyevans32
Copy link
Author

Johnnyevans32 commented Jan 8, 2022

more ref to the issue

@serdartepeyurt
Copy link

The issue raises from ssr render cycle, since ssr mode doesnt have any window object. You need to wrap your code into a block something like

if(window){
...
}

and you will be fine.

@GZ2829
Copy link

GZ2829 commented Feb 3, 2022

you need to wrap the web3modalvue in client-only or no-ssr tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants