Bug
Problem
GlassToastProvider directly uses browser globals:
crypto.randomUUID?.()
window.setTimeout(...)
It also does not clean up active timeouts if the provider unmounts.
Impact
- Crashes in SSR or non-browser environments (e.g., Next.js, tests).
- Possible memory leaks or React warnings due to state updates after unmount.
Location
src/components/GlassToast.tsx
Suggested Fix
- Replace browser-only globals with guarded access:
- Use
globalThis.crypto?.randomUUID?.() with a fallback.
- Use
globalThis.setTimeout or guard against missing window.
- Track timeout IDs using
useRef.
- Clear all pending timeouts in a cleanup effect on unmount.
Bug
Problem
GlassToastProviderdirectly uses browser globals:crypto.randomUUID?.()window.setTimeout(...)It also does not clean up active timeouts if the provider unmounts.
Impact
Location
src/components/GlassToast.tsxSuggested Fix
globalThis.crypto?.randomUUID?.()with a fallback.globalThis.setTimeoutor guard against missingwindow.useRef.