react-modal-video icon indicating copy to clipboard operation
react-modal-video copied to clipboard

ReferenceError: window is not defined at new ModalVideo

Open BrendoSPinheiro opened this issue 4 years ago • 2 comments

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)

BrendoSPinheiro avatar Dec 23 '21 18:12 BrendoSPinheiro

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

// Use this way

mmestiyak avatar Dec 27 '21 09:12 mmestiyak

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

MattFanto avatar Dec 30 '21 09:12 MattFanto

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

uidev1116 avatar Jan 30 '23 07:01 uidev1116