Uncaught reference error : AJS is not defined

We have added the dependency in web resources.

com.atlassian.auiplugin:dialog2
com.atlassian.auiplugin:ajs

but getting the error as uncaught reference error : AJS is not defined