Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Uncaught ReferenceError: AP is not defined

Deniz Oğuz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2016

I'm developing an Atlassian Connect add-on for confluence. It is a static add-on. It has a dynamic content macro that loads external content. My add-on works in normal page view but I'm getting 'Uncaught ReferenceError: AP is not defined' error in macro preview window and in page preview mode. On line 8 of following attached code. Note that this is not my code. Other than preview, macro edit window works fine. I'm sure that all.js is loaded from host server, otherwise macro would not work in normal page view mode too. Is there any idea why I'm getting this error? Thanks.

//If the are the top frame (Confluence)
        if(window.top === window) {
            _AP.addonOriginMap = iFrameData.addonOriginMap || {};
            require(['connect-host', 'ac/cookie', 'ac/env', 'ac/inline-dialog', 'ac/dialog', 'ac/messages', 'ac/request', 'ac/history'], function(host){
                host.create(iFrameData);
            });
        } else { //If we are a plugin frame
            AP.require('_create-inner-frame', function(createInnerFrame) {
                createInnerFrame(iFrameData);
            });
        }

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Mohammed Davoodi
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 19, 2016
0 votes
Mohammed Davoodi
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 19, 2016

I'm working on a Confluence macro as well and I'm getting the same error. My macro worked fine before but now this error is popping up. It might be a bug on Atlassian's side.

TAGS
AUG Leaders

Atlassian Community Events