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
    Nov 5 '18 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
    Nov 8 '18 at 12:52

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, privacy policy and cookie policy

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