Recently, I made the decision to switch my Typescript transpilation options from targeting ES5 to ES6.
Although a certain syntax had always functioned perfectly under ES5, a particular error started appearing in the browser console (specifically Firefox) after the target change:
Javascript ES6 TypeError: Class constructor Client cannot be invoked without 'new'
I ended up modifying the code to fit a more suitable syntax for ES6, which resolved the issue. However, what puzzles me is why the browser would signal this error now when the exact same code had been functional previously.
Could it be that the javascript parser within the browser scans through other parts of the codebase and recognizes the usage of ES6 elsewhere, leading it to reject this specific line due to not aligning with the ES6 code found elsewhere?