gilbarbara / react-joyride

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

Not working in the production mode. #1038

Closed yashnerkar closed 3 weeks ago

yashnerkar commented 1 month ago

🐛 Bug Report

In production, the React Joyride tour is not functioning correctly, causing the following error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0').

To Reproduce

Steps to reproduce the behavior:

  1. Implement a tour using React Joyride in a separate tour.tsx component.
  2. Import and use the tour.tsx component in other components as needed.
  3. Build the application for production.
  4. Deploy and run the production build.

Expected behavior

The React Joyride tour should function as expected in production, similar to its behavior in the development environment, without throwing any errors.

Link to repl or repo (highly encouraged)

Locally Build - Loom video

gilbarbara commented 1 month ago

Are you using next.js? Try adding a 'use client'; in your tour component before all the imports. Or setting swcMinify: false to your next.js config.

yashnerkar commented 3 weeks ago

Thanks @gilbarbara ! It worked well.