Trying to work with Next.js #143
-
Hi there! Been trying to get this setup in my project with Next.js. I'm a bit confused on how to get it working with the Dynamic Imports that are mentioned in the docs, could someone provide an example on how to use it in Next.js? If I try to import the module like any other module, I get this error:
I'm unsure how to fix/change this, any advice/tips? This is using the current version of Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hey @zzulanas Create a wrapper component for the player and add |
Beta Was this translation helpful? Give feedback.
-
@AnmaritoS Sorry, I can't help with the implementation... |
Beta Was this translation helpful? Give feedback.
-
Hey @zzulanas. There's nothing wrong with your implementation. Unfortunately, it's not something you can fix yourself without patching this package. Possible solutions:
with
(this is almost literally what the error suggests to do, by the way, and the one I would choose if I were @gilbarbara ) Any one of these options would fix the issue. @gilbarbara what do you think? |
Beta Was this translation helpful? Give feedback.
-
@zzulanas FYI: The issue is fixed in |
Beta Was this translation helpful? Give feedback.
Hey @zzulanas
Create a wrapper component for the player and add
'use client';
before anything else.The Spotify Web Playback SDK is a client-only library dependent on the
window
.