Some times Configurable options are not loaded in product detail page and i get this error on console

In firefox I get this error on console:

TypeError: settings.fotoramaApi is undefined

In chrome i get this error:

Uncaught TypeError: Cannot read property 'setOptions' of undefined on gallery.js:462

updateOptions: function (configuration, isInternal) {

    var $selectable = $('a[href], area[href], input, select, ' +
        'textarea, button, iframe, object, embed, *[tabindex], *[contenteditable]')
        .not('[tabindex=-1], [disabled], :hidden'),
        $focus = $(':focus'),

    if (_.isObject(configuration)) {

        //Saves index of focus
        $selectable.each(function (number) {
        if ($(this).is($focus)) {
            index = number;

        if (this.isTouchEnabled) {
        configuration.arrows = false;
        configuration.click = false;
        configuration.breakpoints = null;

        if (!isInternal) {
        !_.isEqual(settings.activeBreakpoint, {} && settings.brekpoints) ?
            $.extend(true, settings.activeBreakpoint.options, configuration) :

            settings.isFullscreen ?
            $.extend(true, settings.fullscreenConfig, configuration) :
            $.extend(true, settings.defaultConfig.options, configuration);

        $.extend(true, settings.currentConfig.options, configuration);

        if (_.isNumber(index)) {

I am using Magento 2.2.5, occurs in both production and developer mode.

Configurable options are : size (dropdown) and color (swatches)

If I refresh page or click add to cart error resolve and size, color appears.

How can I debug this issue?


the error was generated by this code (for desktop version)

.fotorama-item.fotorama {

change with

.fotorama-item.fotorama {
    position: fixed;
    right: -5000px;

The cause of this behaviour is the "display:none" css styling. Fotorama don't load in something that is hidden.

Se also here: fotorama cant get the api object

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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