-
Notifications
You must be signed in to change notification settings - Fork 48
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
ReferenceError: window is not defined #39
Comments
Why not give a mock window object when in SSR. |
@bsdfzzzy Any suggestion on this? |
Many third partern use |
Hello @RayonDabre @bsdfzzzy, I'm currently learning about Vue, Gridsome, and have been doing some searching trying to better handle touch events in a Gridsome application where I believe it's build process behaves similar to
@RayonDabre I'm not familiar with what @bsdfzzzy was alluding to regarding Mozilla, but perhaps you can try using vue2-touch-events. I got I hope that helps. @bsdfzzzy For non |
I also use Gridsome and encountered this issue. You'll find the solution I found below. In your export default function(Vue, { isClient }) {
if (isClient) {
const { VueHammer } = require('vue2-hammer')
Vue.use(VueHammer)
}
} @bsdfzzzy Mocking |
In the contest of
SSR
, getting error asReferenceError: window is not defined
.Any suggestion to make it SSR compatible?
The text was updated successfully, but these errors were encountered: