svg-inject icon indicating copy to clipboard operation
svg-inject copied to clipboard

SSR Friendly

Open OwenMelbz opened this issue 4 years ago • 0 comments

Hi,

Was trying to checkout your library to use in a Next.js project.

However as Next uses SSR and "window" doesn't exist this package fails with:

ReferenceError: window is not defined

I looked through the code, and it seems that the only use window has is to bind to a global namespace?

Would you consider removing this code to make it compatible, or maybe putting a conditional around it to make sure it only binds when a window actually exists?

Thanks :)

OwenMelbz avatar Mar 22 '20 09:03 OwenMelbz