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

ReferenceError: document is not defined #104

Closed
vutpov opened this issue May 6, 2020 · 4 comments
Closed

ReferenceError: document is not defined #104

vutpov opened this issue May 6, 2020 · 4 comments

Comments

@vutpov
Copy link

vutpov commented May 6, 2020

Hello,
Can you help me on this? What seem to be the problem?

@vutpov vutpov changed the title Hello, ReferenceError: document is not defined May 6, 2020
@infeng
Copy link
Owner

infeng commented May 6, 2020

Can you provide a reproduction by codesandbox?

@vutpov
Copy link
Author

vutpov commented May 17, 2020

my bad
i overlooked that your component does not support ssr yet

@infeng infeng closed this as completed Jun 22, 2020
@gromov-io
Copy link
Contributor

плохо,
я упустил из виду, что ваш компонент еще не поддерживает ssr

I use NextJS - there are no problems, an example of my code

import React, { FC } from 'react'
import dynamic from 'next/dynamic'

const Viewer = dynamic(
  () => import('react-viewer'),
  { ssr: false }
)

export const Gallery: FC = () => {
  return (
    <Viewer
      visible={true}
      onClose={() => {}}
      images={[{src: ''}]}
    />
  )
}

export default Gallery

@bhrugu09
Copy link

bhrugu09 commented Jan 7, 2022

плохо,
я упустил из виду, что ваш компонент еще не поддерживает ssr

I use NextJS - there are no problems, an example of my code

import React, { FC } from 'react'
import dynamic from 'next/dynamic'

const Viewer = dynamic(
  () => import('react-viewer'),
  { ssr: false }
)

export const Gallery: FC = () => {
  return (
    <Viewer
      visible={true}
      onClose={() => {}}
      images={[{src: ''}]}
    />
  )
}

export default Gallery

worked for me

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

4 participants