SupremeTechnopriest / react-idle-timer

User activity timer component
https://idletimer.dev
MIT License
1.15k stars 143 forks source link

working in dev but error in production #329

Closed seyyidt closed 1 year ago

seyyidt commented 1 year ago

Bug information

Affected Module

version 5.5.2

Describe the bug

Using the idleTimer works with npm run dev. But the same code gives an error in production. We are using next.js.

I am not sure if this is a bug with idleTimer or a general issue with swcMinifier.

To Reproduce

  1. create simple next.js app. npx create-next-app@latest
  2. recreate the idletimer example
  3. run npm run build-prod and npm start
  4. open the browser, it will show you the error "Application error: a client-side exception has occurred (see the browser console for more information)."

Expected behavior

it should just work.

Screenshots

Screenshot 2023-02-07 at 11 15 48

System Information (please complete the following information)

Additional context

I couldn't find any proper solution online and the only workaround I could find is disabling SWC minify.

Since I couldn't find anything online specifically to this error, maybe it could be a help for other people experiencing the same issue.

seyyidt commented 1 year ago

updating to the latest version of next.js solved this issue.