Next.js Discord

Discord Forum

FreshChat Widget Disappears on

Unanswered
Philippine Crocodile posted this in #help-forum
Open in Discord
Philippine CrocodileOP
Language Switch in Next.js SPA
Platform: Next.js 14+ with next-intl | FreshChat Web Widget
Issue:
The FreshChat widget disappears when switching languages via client-side navigation. It only reappears after a full page refresh.
User Flow to Reproduce:
Load page (English or Arabic) → Widget appears after ~5 seconds
Switch language using next-intl Link component (client-side navigation)
Widget disappears immediately
Refresh page → Widget reappears
Technical Details:
Next.js App Router with next-intl for i18n
FreshChat script: //fw-cdn.com/8681188/3346163.js
Language switching uses client-side navigation (no full page reload)
Widget initialized with locale: ar-SA or en-US
What I've Tried:
Implemented destroy and reinitialize approach from Freshworks Community
Using widget:destroyed event to reinitialize
Setting window.fcWidgetMessengerConfig before script load
Appending script to <head> instead of <body>
Current Behavior:
Widget destroys successfully on language switch
widget:destroyed event fires
Script reloads but window.fcWidget remains undefined after script load
Widget doesn't reinitialize

0 Replies