Infinite loading

Hi,

I’m creating a new react app on freshservice on full_page mode. When I try to display it, I have to hit the refresh button several time before the app shows me the default home page. I’ve seen another post like this on this forum but there wasn’t any answer.

Thanks for your time.

Hey @zaidschouwey98 ,

Could you please share a screen grab of the issue, or you app’s source code so we can take a look at it?

Stay safe :slight_smile:

2 Likes


Here’s the errors, it does the same with a blank react project

I’ve tried creating a blank react project, the only thing I’ve changed is the manifest :

{
  "platform-version": "2.0",
  "product": {
    "freshservice": {
      "location": {
        "full_page_app": {
          "url": "index.html",
          "icon": "icon.svg"
        }
      }
    }
  },
  "whitelisted-domains":[]
}

The errors are the same as my project :

And I still need to reload the page 5 to 10 times to show the content. Otherwise it’s just charging.

Have you seen this before ? @velmurugan

I manage to solve the problem by changing a bit of the App.js code
Looks like the app.initialized() is the problem.

useEffect(() => {
    const script = document.createElement('script');
    script.src = 'https://static.freshdev.io/fdk/2.0/assets/fresh_client.js';
    script.addEventListener('load', () => setLoaded(true));
    script.defer = true;
    document.head.appendChild(script);
  }, []);

  useEffect(() => {
    if (!loaded) return

      setChild((<MainScreen/>))
   
  }, [loaded])

  return (
    <div>
      {child}
    </div>
  )

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.