Issue with one of the customer's Freshdek account

@Akhil_Kulkarni The value of app becomes available to the app using

    <script async src="https://static.freshdev.io/fdk/2.0/assets/fresh_client.js"></script>

in the associated HTML file.

You must ensure that your app.js starts to execute after fresh_client.js first executes

    <script async src="https://static.freshdev.io/fdk/2.0/assets/fresh_client.js"></script>
    <link rel="stylesheet" type="text/css" href="styles/style.css" />
  </head>

  <body>
    <div class="main">
      <p>Utilize this template code to build your App</p>
      <p id="apptext"></p>
    </div>
  </body>

  <script defer src="scripts/app.js"></script>
  <script async type="module" src="https://unpkg.com/@freshworks/crayons@3/dist/crayons/crayons.esm.js"></script>
  <script async nomodule src="https://unpkg.com/@freshworks/crayons@3/dist/crayons/crayons.js"></script>
</html>

You can ensure it by understanding the difference: Scripts: async, defer

Usually, if you do not solve the order of scripts loading using async or defer, then next option is to fall back to enclosing document loading apis such as document.onreadystatechange or document.readyState etc.,

1 Like