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?
Community moderators have prevented the ability to post new answers.
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>
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you add the <context>customerportal</context> to your web-resource?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.