When trying to access JQuery in 9.7 from a servlet page like so
require(['jira/api/jquery-2.2.4'],($)=>{console.log($)})
we get
almond.js:297 Uncaught Error: undefined missing jira/api/jquery-2.2.4 at main (almond.js:297:27) at almond.js:372:17
This happens despite having defined a web resource dependency on JQuery:
<dependency>jira-frontend-api:jquery-2.2.4</dependency>
Hello @MarkusDarko!
Apologies for the inconvenience. I can see a bug in the WR-dependency in the frontend-api module.
Please use <dependency>jira.webresources:jquery</dependency>
before <dependency>jira-frontend-api:jquery-2.2.4</dependency>
. It’ll also work after the fix.
Best,
Rzymek
1 Like
Thank you for the reply, Rzymek. Unfortunately, that did not resolve the issue - the module is still unavailable. We have a workaround for now, though.
Best,
Markus
1 Like
Uh, I’m happy you have a workaround working.
Although, it’s odd that adding <dependency>jira.webresources:jquery</dependency>
didn’t solve the issue. As WRM doesn’t guarantee the order of <dependency>
it might be that in your case. For sure, you should be able to see jquery
AMD module with it.
Neverthless, we’ll work on the fix in the frontend-api module as well as revamping it a bit. This shouldn’t happen in the first place.
Best,
Rzymek
1 Like