When I upgraded my Magento 2.2.2 to 2.2.6.

I got one critical error in pub/static missing one file named trim-input.js


I try add this to requirejs-config.js:

var config = {
    map: {
        '*': {
            'trimInput': 'mage/trim-input'

How can I add this to static content?

I cant add it in pub/static/... because after bin/console exec setup:static-content:deploy -f file was deleted.

  • Did you get an answer to this as I now have the same issue
    – Goose84
    Commented Nov 5, 2018 at 10:54
  • Yes you need to -add or edit: app/design/frontend/{...}/{...}/requirejs-config.js var config = { map: { '*': { 'trimInput': 'mage/trim-input' } }, }; -and add: app/design/frontend/{...}/{...}/web/mage/trim-input.js
    – BotGun
    Commented Nov 8, 2018 at 12:52

1 Answer 1


Make sure the file exists in:


If the file is not there, it won't be copied over into pub/static

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.