I installed Magento 2.2.2 and getting issue with image gallery js. Product page images are not loading sometimes with below error

settings.$elementF.fotorama is not a function

enter image description here

  • magento.stackexchange.com/questions/198572/… the keyword "sometimes" may mean some elements are not loaded when called, check require js in your design package.
    – B00MER
    Jun 22, 2018 at 1:13
  • Hi did you get a fix of that issue. I am facing the same problem after updating porto theme Oct 2, 2018 at 23:51
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review
    – Jarnail S
    Oct 3, 2018 at 3:35
  • Did you get any solution ? Mar 2, 2020 at 11:09
  • @zedBlackbeard yes issue with the theme js load order. some js are not loaded so i just change the order and all work are smooth
    – Ajay Patel
    Mar 3, 2020 at 12:02

1 Answer 1


I had an external script that was causing this. I'm still not sure why, but in my case it was a script from Constant Contact (yours may be different).

Instead of including it in the header scripts, I moved it into a block (not sure if that did anything) and then I added an async tag to that script. That seems to have done it.

To troubleshoot, remove all of your third party scripts and see if that makes $fotorama run consistently. If it does, add the scripts back slowly until you figure out which one is breaking $fotorama.

Add an async tag to that script, and it should work.


<script async> var _ctct_m = "<my cc id>"; </script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.