Hi,
This post is a follow-up to this topic that I posted some time ago: React createRoot() not working in Modal
I have recently started trying to update our Freshworks widgets to the new react-starter-template but it does not seem to be working correctly. Even when I just use the starter template with minimal changes, it does not work as it is supposed to. This is my issue:
The starter-template contains a minimal app that just presents a welcome message and the currently logged in users username. The problem I am having is that the username is only displayed when you hard load the browser the first time. On following hard reloads, the username is not displayed and I can see in the logs that the client.data.get('loggedInUser') call never resolves. It does however work if you just save one of the files so the app does a hot reload. If you stop the app using Ctrl + C and the run fdk run, it works for the first load again, but as soon as you do another hard reload, the client stops responding to calls. It does occasionally work on repeated hard reloads, but it is rare. This makes me believe it is some kind of timing or race condition issue.
I have attached a zip-file with the complete example app, the only things I have changed from the starter template is the manifest.json file (to activate the app in the ticket sidebar) and added some logging to the App.jsx-file.
Note that the behavior is the same both in the ticket sidebar and for the full page app.
I am running the latest FDK version (10.1.2) and Node 24.11.0, my dev-machine is running Windows 11.
Would be great to know if others have the same issue? Because right now I can only see three possible explanations:
- There is a bug in the Freshworks-platform itself.
- The react-starter-template is faulty.
- I have some strange issue deeper in my local dev-environment.
Thanks in advance!
freshdesk-test.zip (131.2 KB)