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

error - ReferenceError: EventTarget is not defined #245

Open
Jairwin-L opened this issue Jun 2, 2023 · 10 comments
Open

error - ReferenceError: EventTarget is not defined #245

Jairwin-L opened this issue Jun 2, 2023 · 10 comments

Comments

@Jairwin-L
Copy link

Jairwin-L commented Jun 2, 2023

install using pnpm, then pnpm dev
image
env info

"@u-wave/react-vimeo": "^0.9.10",
"react": "18.2.0",
"react-dom": "18.2.0",
@goto-bus-stop
Copy link
Member

It looks like you're server-rendering. this component does not support that.

@Jairwin-L
Copy link
Author

It looks like you're server-rendering. this component does not support that.

yes, but using yarn is ok, so I want to know why there is a problem with using pnpm

@goto-bus-stop
Copy link
Member

that's impossible to say without a full, runnable example of the problem :)

@Jairwin-L
Copy link
Author

let me try

@Jairwin-L
Copy link
Author

@goto-bus-stop I re-reproduced this problem. It seems to be because of the node version. There are two node versions on my computer: 14.19.3 and 18.0.0. The 14 version will have this error, and the 18 version will not

@goto-bus-stop
Copy link
Member

so really @u-wave/react-vimeo shouldn't be loaded at all on the server, as it includes @vimeo/player which is a client-side only library. This component can't do anything on the server and does not support server-side rendering.

@goto-bus-stop
Copy link
Member

If you are using next I guess you should only import it in client components, but I don't use next myself so I can't say more.

@tony-matheus
Copy link

@Jairwin-L if you are using next (what looks like you do), you may try to dynamically import the component with { ssr: false}

@johndavemanuel
Copy link

@Jairwin-L did you able to make it work on node 14?

@Jairwin-L
Copy link
Author

@Jairwin-L did you able to make it work on node 14?

sorry, I kind of forgot about it

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