Endless Error/Reload Cycle in App Scaffold



  • Cheryl Lane


    I've not used the scaffold myself, but have some knowledge of JS and the ZAF client. Taking a look over the app scaffold code, I think I can see where you might be running into issues.

    In the base state of the scaffold, there are a number of JS files that build into the eventual JS that loads when you open the compiled app, these go javascripts/locations/ticket_sidebar.js (where "client" is already initiated) which calls /modules/app.js which then gets all the data (in this case, the user info) and then calls the default.js that you've modified.

    If the only file you've modified in this is the default.js file, you're in a state where the ZAFClient is already set up and you're creating it again.

    Arguably this scaffold isn't the most user friendly, but what you would do is modify default.js only with the html you want to display and modify the modules/app.js function init() to get data from the client instance and pass it to the default.js by adding it to this.states and then using it in the default.js file in the same way with the template string.

    If you're processing anything that does not need the client, this can be done in default.js before the render or in the app.js and passed the same way.

    Hope this helps,


  • Ryan Carpenter

    That makes sense. Thanks. I guess I saw that ZAFClient was letting me render what I wanted, so I never looked closely enough at the other files.

  • Eric Nelson
    Zendesk Developer Advocacy

    Thanks for helping Cheryl Lane


Please sign in to leave a comment.

Powered by Zendesk