App Studio Development Troubleshooting

Troubleshooting

Data is not appearing on the page as expected

Check response data

If you open your browser’s dev tools, choose the ‘Network’ tab, and look for an XHR request similar to the one shown below (starting with platforms.fusion…) you can navigate through the values being returned from Fusion.

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

You can then track down the value you’re looking for in here. 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.

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, etc..)

+ image:/assets/images/app-studio/4.2/devguide1.png

+ image:/assets/images/app-studio/4.2/devguide2.png

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 as a middle-man. Note that you’ll need your logger 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"/>

Look in the webapps logs are under fusion/version/var/log/webapps/. You can sort them by date (ls -l) and view the latest one with the suffix of stderrout. In 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

To determine which entry is the correct one, you’ll need to 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, etc..).

You can then go to the query workbench in Fusion and select the Published URI in the URI tab:

+ image:/assets/images/app-studio/4.2/devguide3.png

Remove every parameter given in this URL after ‘select?’, append the parameters from the webapps logs and put this URL into your browser. The result will be response of the query fired by App Studio, but unaltered by App Studio.

Page is totally blank/elements look broken or strange

Check browser console

If you open your browser’s dev tools, choose the ‘Console’ tab, you can check for any issues related to client side components. If you see the following error, you should wipe your node modules directory and reinstall them before building. Otherwise typically an error here suggests there is a problem in your Javascript code.

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.

Perform the following steps to reinstall the node modules.
1. rm -rf node_modules package-lock.json
2. pm cache clear -f
3. npm install

Ensure there are no errors in any of your custom javascript code.