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?
1 Answer 1
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 :)
-
Yes
adminhtmlcontains this js. But i can't find the reference to this file in the theme. Any help to find it. where i can search for it.Nitin Pawar– Nitin Pawar2017年06月13日 08:07:56 +00:00Commented Jun 13, 2017 at 8:07 -
@NitinPawar Please use PhpStorm or whatever you like and search for 'Magento_ConfigurableProduct/js/variations/paging/sizes.js' inside 'frontend/Smartwave/shopperbays'Toan Nguyen– Toan Nguyen2017年06月13日 08:09:00 +00:00Commented Jun 13, 2017 at 8:09
-
I searched everywhere in theme and other modules but i can't found the reference for file. Also tried to remove file using
<remove src="file_name">but it is not working.Nitin Pawar– Nitin Pawar2017年06月13日 11:42:20 +00:00Commented Jun 13, 2017 at 11:42 -
@NitinPawar I'm so sorry, inside frontend/Smartwave/shopperbays may not contain this, it must be specified inside app/code/SmartwaveToan Nguyen– Toan Nguyen2017年06月14日 06:41:57 +00:00Commented Jun 14, 2017 at 6:41