gilbarbara / react-joyride

Create guided tours in your apps
https://react-joyride.com/
MIT License
6.62k stars 519 forks source link

Global is not defined #940

Closed shiranZe closed 9 months ago

shiranZe commented 9 months ago

🐛 Bug Report

Hello, I've been using the react-joyride library in my project, and it relies on the react-floater package, which uses the global object. However, my project is using Vite, which doesn't define a global obkect in the window (unlike Webpack), this leads to this error:(uncaught exception)ReferenceError: global is not defined. To address this issue, I've had to enable certain polyfills, but these have caused build failures.

I've noticed that there's an update available for the react-floater package. Would it be possible to update the dependacy version? Such an update would elp ensure compatibility with Vite projects.

gilbarbara commented 9 months ago

Hey @shiranZe

The react-floater 0.8.x isn't compatible with react-joyride yet. Defining global shouldn't break the build. What errors are you getting?

gilbarbara commented 9 months ago

Duplicate #772

BennyAlex commented 7 months ago

@gilbarbara Please reopen this. The libary uses a global variable, that is not defined in every environment, so it should be using a fallback here. Can you please check it again?

I cant use joyride with vite. It will break. Even with the 'fix' from the other comments, the build will fail then.

gilbarbara commented 7 months ago

@BennyAlex Fixed in 2.7.1