appleple / react-modal-video

Accessible React Modal Video Component
https://appleple.github.io/react-modal-video/
MIT License
177 stars 86 forks source link

ReferenceError: window is not defined at new ModalVideo #75

Closed BrendoSPinheiro closed 1 year ago

BrendoSPinheiro commented 2 years ago

How to properly handle provider with SSR ? I'm having this throwing error.

ReferenceError: window is not defined at new ModalVideo (react-modal-video/lib/index.js:35:76)

mmestiyak commented 2 years ago

import dynamic from 'next/dynamic'; const ModalVideo = dynamic(() => import('react-modal-video'), { ssr: false });

// Use this way

MattFanto commented 2 years ago

I faced the same issue in Gatsby while upgrading from 1.2.7 to 1.2.8, also downgrading to 1.2.7 seems to solve the problem

uidev1116 commented 1 year ago

@MattFanto Sorry for late reply. Could you please check https://www.gatsbyjs.com/docs/debugging-html-builds/ ?