gilbarbara / react-floater

Advanced tooltips for React
https://codesandbox.io/s/github/gilbarbara/react-floater/tree/main/demo
MIT License
220 stars 37 forks source link

Vite fails to build/run because of "global is not defined" #83

Closed wuifdesign closed 2 years ago

wuifdesign commented 3 years ago

🐛 Bug Report

Uncaught ReferenceError: global is not defined when running dev mode with https://vitejs.dev/. For the build i may use the solution from https://github.com/gilbarbara/react-floater/issues/75

I also get the error Cannot call a namespace ('equal') during build, but i can't finde out if it is related to react-floater or react-joyride.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new project with https://vitejs.dev/
  2. Try to use https://github.com/gilbarbara/react-joyride (which depends on react-floater)

Expected behavior

Should run/build

Pernick commented 3 years ago

I am getting both of those errors with Vite app. Have you had any progress with it? I will dig around a bit and report back if I find something useful.

gilbarbara commented 3 years ago

Can you please try react-floater@next and report?

Pernick commented 3 years ago

Hello, I created a repo, where I tested this.

react-floater@latest - https://github.com/Pernick/react-floater-global-not-defined/tree/floater-latest

react-floater@next - https://github.com/Pernick/react-floater-global-not-defined/tree/floater-next

I am unfortunately busy right now with different task, so I put this in a background for a bit, but hopefully I can get to it this evening.

Also vite caches the dependencies, so whenever you would wanna try some changes in versions its good idea to delete node_modules/.vite/ before running npm run dev

EDIT: I am unable to get to it this week, hopefully weekend will be less hectic.

RaitoBezarius commented 2 years ago

Just ran into this issue, too. I tried to enable various polyfills without any success with Vite.

gilbarbara commented 2 years ago

Fixed in 0.8.0

JimmyRowland commented 2 years ago

In 0.8.0 I am getting equal3 is not a function

genk1 commented 2 years ago

Getting same problem in 0.8.0 Uncaught TypeError: equal3 is not a function

NUKSI911 commented 2 years ago

Getting same problem in 0.8.0 Uncaught TypeError: equal3 is not a function

gilbarbara commented 2 years ago

This is issue was about the global variable...