Magento – Unable to resolve the source file for error in custom theme

javascriptmagento-2.1requirejs

I am working on magento version 2.1.3 and have a custom theme shoppersbay. For some js files it gives error like

Unable to resolve the source file for
'frontend/Smartwave/shoppersbay/en_US/Magento_ConfigurableProduct/js/variations/paging/sizes.js'
0 /home4/shoppoz8/public_html/shoppersbay/vendor/magento/framework/App/StaticResource.php(97): Magento\Framework\View\Asset\File->getSourceFile()
1 /home4/shoppoz8/public_html/shoppersbay/vendor/magento/framework/App/Bootstrap.php(258):
Magento\Framework\App\StaticResource->launch()
2 /home4/shoppoz8/public_html/shoppersbay/pub/static.php(13): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\StaticResource))
3 {main}

I searched for the file sizes.js but i didn't find any in theme and in vendor directory. How can i resolve it?

Best Answer

Because that file sizes.js is not belong to frontend scope. It belongs to adminhtml.

magento/module-configurable-product/view/adminhtml/web/js/variations/paging/sizes.js

/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
define([
    'Magento_Ui/js/grid/paging/sizes'
], function (Sizes) {
    'use strict';

    return Sizes.extend({
        defaults: {
            excludedOptions: ['100', '200']
        },

        /**
         * @override
         */
        initialize: function () {
            this._super();

            this.excludedOptions.forEach(function (excludedOption) {
                delete this.options[excludedOption];
            }, this);
            this.updateArray();

            return this;
        }
    });
});

Solution for your problem is delete any references to sizes.js in your custom theme. And asks the vendor to fix it, obviously :)

Related Topic