2

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?

1
  • Hi I am also trying to override js file which is in the base. Did you get any solution? Mar 9, 2018 at 11:27

1 Answer 1

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

12
  • and the path for the js file are ok? Oct 3, 2017 at 10:19
  • i tried and is not working Oct 3, 2017 at 10:23
  • @AlinLupoiu which area you are looking for?
    – Bojjaiah
    Oct 3, 2017 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 Oct 3, 2017 at 10:37
  • namespace/module/js/form/date.js net::ERR_ABORTED required.js 1895 Oct 3, 2017 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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