2

I try to override the Magento/Checkout/view/frontend/web/js/view/shipping.js file in my custom theme.

New location of the file:

app/design/frontend/Vendor/theme/Magento_Checkout/web/js/view/shipping.js

Location of my requirejs-config.js file:

app/design/frontend/Vendor/theme/requirejs-config.js

Contents of my requirejs-config.js file:

var config = {
 map: {
 '*': {
 'Magento_Checkout/js/view/shipping': 'js/view/shipping'
 }
 }
};

I refreshed all caches and deployed static content but I keep getting the following 404 error in my console:

GET http://domain.loc/pub/static/frontend/Vendor/theme/nl_NL/js/view/shipping.js 

I also tried to move the requirejs-config.js file into my Magento_Checkout folder.

Rakesh Jesadiya
42.5k19 gold badges135 silver badges186 bronze badges
asked Jan 4, 2017 at 9:19
1
  • please let me know if you have any issue. Commented Jan 4, 2017 at 9:26

1 Answer 1

5

When you want to create module at that time you need to create requirejs-config.js file to override js file in module.

In theme you dont need to create require js file you can directly set js file in specific order of core module.

You dont need to create requirejs-config.js file in your theme.

Remove requierejs-config.js file from theme.

You have to set only js file in your theme.

Your path is correct.

app/design/frontend/Vendor/theme/Magento_Checkout/web/js/view/shipping.js

please run command,

php bin/magento setup:static-content:deploy nl_NL

Remove var folder Clear Browser cache.

answered Jan 4, 2017 at 9:21
2
  • I tried this before. The error is gone but it seems that the original file is not overwritten. Commented Jan 4, 2017 at 9:48
  • have u deploy and clear browser cache? Commented Jan 4, 2017 at 9:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.