Closed aryadaulat closed 1 year ago
Is this error happening in dev mode, or it only occurs once you build and run the project
Hi, the problem is that in SS you dont have access to browser api. To solve that next have a build in functionality that allows to render certain components in Client Side. here the source:https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr
the solution will be import the component like this:
..
import 'react-image-picker-editor/dist/index.css'
import dynamic from 'next/dynamic'
const ReactImagePickerEditor = dynamic(() => import('react-image-picker-editor'), {
ssr: false,
})
...
Error Window is not defined if me refresh in page using this library , and error window when i try to push to vercel , im using Next JS
ReferenceError: window is not defined -- 21:03:17.721 | at /vercel/path0/node_modules/react-image-picker-editor/dist/index.js:1:11981 21:03:17.722 | at Object.