Apr 13, 2019
0
Level 13
Strange Laravel Mix / Webpack Behavior
Since last ~4 hours, I'm facing a strange issue and I'm not sure about its origin. Here's what's happening -
Out of nowhere, when I run npm run dev, Mix seems to be adding brackets on its own. For example - the following line from my JavaScript
}).catch(function (error) {
automatically changes to -
})["catch"](function (error) {
Notice the ["catch"] being added. I found this out while committing files with phpStorm. Also, with this, I'm getting following error upon npm run dev -
SyntaxError: unknown: Identifier '_typeof' has already been declared (20:9)
18 | linkAlwaysNoFollow:true,linkAutoPrefix:'https://',listAdvancedTypes:false,paragraphFormat:{N:'Normal',H2:'Heading 2',H3:'Heading 3',H4:'Heading 4',PRE:'Code'},requestHeaders:{'X-CSRF-TOKEN':$('meta[name="csrf-token"]').attr('content')}};
19 |
> 20 | function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
| ^
21 |
22 | /**
23 | * Fileuploader
I'm unable to figure out what's going wrong; because I don't remember doing anything with these files. Can someone point me in the right direction?
Please or to participate in this conversation.