Troubleshoot App Studio Development

This topic provides troubleshooting tips for issues that can arise when developing web apps using App Studio.

Data is not appearing on the page as expected

Check the response data

  1. Open your browser’s developer tools.

  2. Click the Network tab.

  3. Look for an XHR request similar to the one shown below (starting with platforms.fusion…) and select it.

    devguide1

    Here you can navigate through the values being returned from Fusion.

  4. To determine which response is which (as you may have multiple) look at the platform that populates the response, which also populates the element on your page.

    You can then track down the value you’re looking for. So if looking at results, a result list iterates through the results, so we should look inside a result. In each result, there’s a set of fields and associated values:

    devguide2

    Note that other processing may happen in between receiving the response and displaying it on the page (response processors, modifications in the HTML, security trimming, and so on).

Get query from webapps/servlet logs and fire it against Fusion

If the data in your response object is not as you expect, you can get the query from the App Studio logs to fire directly against the Fusion endpoint, without App Studio in the middle.

  1. Make sure your logger is configured to print out debug logging for the twigkit class in logback.xml in your environment profile (or if not using a profile, in the main resources directory):

    <logger name="twigkit" level="DEBUG"/>
  2. In fusion/version/var/log/webapps/, sort by date (ls -l) and view the latest one with the suffix of stderrout.

    Here you will see some entries that should follow the format of the following:

    08:57:41.058 DEBUG twigkit.search.solr.SolrPlatform - Searching Solr with start=0&rows=20&hl=true&q=match&facet=true&facet.field={!ex%3Dgenre_ss}genre_ss&facet.field=year_i&fl=*,score&fq={!tag%3Dgenre_ss}genre_ss:(Animation)&username=admin&session=37045658-9052-4ba4-b1d2-0221be5e2d02&spellcheck=true&spellcheck.collate=true&q.op=OR took 200 ms
  3. To determine which entry is the correct one, check the query that populates the response you’re interested in, and match the parameters you’re setting in the tag as well as any Solr parameters being applied to the query via interaction on the page (keyword = q, facet filters = fq, and so on).

  4. Go to the Query Workbench in Fusion and select the Published URI in the URI tab:

    query workbench uri

  5. Remove every parameter given in this URL after select?.

  6. Append the parameters from the webapps logs.

  7. Put the resulting URL into your browser.

    The result will be the response of the query fired by App Studio, but unaltered by App Studio.

Page is totally blank/elements look broken or strange

Check the browser console

  1. Open your browser’s developer tools.

  2. Click the Console tab.

    Here you can check for any issues related to client-side components.

  3. Look for the following error:

    Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
    Error: [$injector:modulerr] Failed to instantiate module lightning due to:
    Error: [$injector:nomod] Module 'lightning' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
    • If you see the error above, you should wipe your node_modules directory and reinstall the modules before building:

      1. rm -rf node_modules package-lock.json

      2. npm cache clear -f

      3. npm install

    • If you do not see this error, then typically there is a problem in your Javascript code.