1

I tried to override magento/module-ui/view/base/web/js/form/element/date.js

For this, I have created a custom module with the following:

view/adminhtml/requirejs-config.js with the following content

var config = {
    "map": {
        "*": {
            "Magento_Ui/js/form/element/date": "namespace/module/js/form/element/date",

        }
    }
}

and in this path namespace/module/view/adminhtml/web/js/form/date.js I have my js.

After deploy, I receive an error in the console, that my js is not found in pub/....date.js

Why this is not created? What I am doing wrong?

  • Hi I am also trying to override js file which is in the base. Did you get any solution? – Kalyan Chakravarthi V Mar 9 '18 at 11:27
1

change your code

var config = {
    "map": {
        "*": {
            "Magento_Ui/js/form/element/date": "namespace/module/js/form/element/date",

        }
    }
}

to path => view/base/requirejs-config.js

 var config = {
        "map": {
            "*": {
                "Magento_Ui/js/form/element/date": "namespace_module/js/form/element/date",
"Magento_Ui/js/form/client": "namespace_module/js/form/client"

            }
        }
    }

after changing the code try to re run setup:upgrade & setup:static-content:deploy command

  • and the path for the js file are ok? – Alin Lupoiu Oct 3 '17 at 10:19
  • i tried and is not working – Alin Lupoiu Oct 3 '17 at 10:23
  • @AlinLupoiu which area you are looking for? – Bojjaiah Oct 3 '17 at 10:34
  • i am looking for ths file base/web/js/form/element/date.js, so is in base. now my files are generated in pub but i still receive other error – Alin Lupoiu Oct 3 '17 at 10:37
  • namespace/module/js/form/date.js net::ERR_ABORTED required.js 1895 – Alin Lupoiu Oct 3 '17 at 10:39

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.