Blank plugin for Confluence Mobile breaks js (deferred.promise is not a function)


I'm trying to style Confluence Mobile, and only thing I've found was this:

with suggestion to create my own plugin.
So I did this using SDK and I have very basic plugin, generated using atlas-create-confluence-plugin

Only thing I've changed is atlassian-plugin.xml and I've changed
context from TreflMobile to what is seen below, so it works on mobile (atl.general don't work with mobile)

<web-resource key="TreflMobile-resources" name="TreflMobile Web Resources">
<resource type="download" name="TreflMobile.js" location="/js/TreflMobile.js"/>
<resource type="download" name="TreflMobile.css" location="/css/TreflMobile.css"/>
<resource type="download" name="images/" location="/images"/>



And then magics happen... I get following error in console when viewing in mobile:

Uncaught TypeError: deferred.promise is not a function
at Function.ajax
at Function.jQuery.(anonymous function) [as get]
at Function.getJSON
at updateAnchors
at Object.setupAnchors
at HTMLDocument.<anonymous>
at fire
at Object.fireWith
at Function.ready
at HTMLDocument.DOMContentLoaded

 This error doesn't happen when my plugin is turned off. 

So I've started troubleshooting:

My .js file is merged into batch.js, I can see my code there. Tried few contents of .js:

1. I've left it blank - error, page doesn't load (stuck on loading)
2. I've inserted there just simple alert('works'); - alert works, page doesn't load (stuck on loading)
3. I've inserted there my desired code - just a shot:

AJS.toInit(function() {
var mytrefl = AJS.$(      [proper,working code there for some lines]

- Code doesn't work, page doesn't load
4. I've stripped it from atlassian-plugin.xml, so .js doesn't load - page loads, but error is still there.

It seems that my plugin causes this error. Any hint why?

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

1,179 views 70 8
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you