Getting ReferenceError AP is not defined

I noticed that every day we get a bulk of errors coming from our cloud app. We show a panel on issue view and sometimes AP is not available resulting with ReferenceError: AP is not defined.

So far I know:

  • it happens on old and new issue view experience
  • position of the panel is irrelevant (we show it on the left and right side)
  • majority of problems are on Chrome, some on Firefox

We load host’s all.js first, later our code (we use webpack) all tags located at the end of the body:

<script src="{{hostScriptUrl}}" type="text/javascript"></script>
<script src="{{{furl '/js/vendors.js'}}}" type="text/javascript"></script>
<script type="text/javascript" src="{{{furl '/js/issue-panel.js'}}}"></script>

So AP should already be there.

I found some previous reports of this problem but for Confluence:

Any hints are welcome as I’m not sure how to investigate that further.


If this error is intermittent, the only thing that comes to mind is if an exception occurs during the elaboration of all.js, perhaps due to it processing the query/context parameters passed in the URL? Depending on when/where the exception occurs, it may prevent AP being set.


Thanks, that inspired me to add some code that will save errors from the beginning and report them back to sentry once it’s loaded, will see if that gives more details.

We have the same issue in Confluence! The xdm_e is always set to in this case, which seems odd.

Maybe someone from Atlassian knows where this URL is coming from? The issue started appearing on June 15th. The customer key in the JWT is set to all kinds of different values, the only thing in common is the unusual xdm_e URL.

Probably related to Using AP.request to fetch content from the Confluence host has recently stopped working?

Same issue for us, any known solutions?

No solution unfortunately. We live with this error :frowning: