Missed Team ’24? Catch up on announcements here.

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

Resources error in JS in SD 3.2.0

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 13, 2016

We have plugin which uses JS to hide some sections on SD customer portal. Everything works fine for SD 3.0.x and 3.1.x but problems occured on SD 3.2.x.

When page is loaded, following error is displayed in JS console:

"Uncaught Error: jira/featureflags/feature-manager missing wrm/data". I can see that wrm/data dependency is created like:

if (typeof define === 'function') {
    define('wrm/data', [], function() {
        return WRM.data;
    });
}

 

I experience that 'define' function is not defined when JavaScript code is executed and wrm/data should be initialized.

It looks like our plugin causes the require and define functions to not to be working sometimes.

Does anyone know what to do to get it all working again?

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 18, 2017

As Rui suggested here I removed AJS dependencies from my web resources which have customerportal set as context. In real I had multiple Atlassian dependencies in my web resources so (historical reasons probably) so I removed them all and everything works great now...

removed dependencies were:

<dependency>com.atlassian.servicedesk.core-ui:sd-jquery-amd</dependency>
<dependency>com.atlassian.soy.soy-template-plugin:soy-deps</dependency>
<dependency>com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path</dependency>
<dependency>com.atlassian.auiplugin:ajs</dependency>
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 19, 2017

sometimes when I want to use define function it still complains that it does not exist, so I'm using hack with setTimeout (200ms in my case) so define has more time to be loaded. Does anyone know how to do it in a nice way?

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 18, 2017

yes Rui, I had this dependency...but your advice with removal of AJS dependency was working for me...I will create an answer here for others to be able to find it...

0 votes
Rui Rodrigues
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.
January 17, 2017

Did you add the <context>customerportal</context> to your web-resource?

TAGS
AUG Leaders

Atlassian Community Events