7

I am replacing the core search module js by custom module using following code.

var config = {
    map: {
        '*': {
            'quickSearch':'All_Search/form-mini'
        }
    }
};

when i checked the requirejs-config.js file from page source i found my configuration are inserted into file at the top

(function(require){
(function() {
var config = {
    map: {
        '*': {
            'quickSearch':'All_SearchAutoComplete/form-mini'
        }
    }
};

and core module config is in middle of file which cause to load the core/default file. If i Changed the my Module name From All to Zall or something alphabetically sort than it works properly. How to solve this issue.

  • Did you try adding a <sequence> <module name="Magento_Search"/> </sequence> in your etc/module.xml? – Renon Stewart Feb 23 '16 at 12:19
  • i tried this <sequece> but not worked...@R.S – Deepak Kumar Feb 23 '16 at 12:58
  • we faced the same problem. also some js files required in core modules rely on the magento blank theme beeing present, which should not be (and is not always) the case. Hoping for a solution here or a "fix" for that in magento2 core – David Verholen Mar 18 '16 at 18:34
2

This issue is regarding setup_version into module.xml, I have faced this and fixed.

Open your module.xml from app > code > YourNameSapce > YourModule > etc.

And

change setup_version="1.0.0" to setup_version="2.0.0"

Then

Run you module again to removing setup from table "setup_module" and run below command into your root magento : php bin/magento setup:upgrade

Then remove your requirejs-config.js and refresh frontend again it will create new requirejs-config.js open it and check.

Please do not forget to remove cache also Flush Static Files Cache.

Hope this will work for you.

Thanks

  • Does not work. Unable to load js – Paras Arora Dec 21 '16 at 12:33
  • Run command : php bin/magento setup:static-content:deploy it might remove your problem. – Hardik Patel Jan 18 '17 at 11:05
  • Hai, im doing what Your mention but don't work for me. May i know what can i did wrongly im added my code below – kamal Sep 22 '17 at 4:20

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.