Why this issue happens custom pages? In we-retail pages it works,
because cq.shared library is included as part of the page itself in the
one of the scripts for ex:
To fix the issue, copy the same the below lines code in any of the
head.html where head is included in your custom page scripts.