walkermatt / ol-layerswitcher

Layer control for OpenLayers
MIT License
384 stars 176 forks source link

Angular 12 Class constructor Control cannot be invoked without 'new' #473

Open bobingham opened 3 years ago

bobingham commented 3 years ago

Reference this issue: Class constructor Control cannot be invoked without 'new'

The only solution I could find is to downgrade the compilerOptions.target in my tsconfig.json file to "es5" from "es2017". I'm not sure this is ideal, are there any plans to upgrade compiler options?

I am now getting the following message during compile:

(Component) depends on 'ol-layerswitcher'. CommonJS or AMD dependencies can cause optimization bailouts.

walkermatt commented 3 years ago

I'm wondering if it's time to publish the ESM module alongside the UMD bundle.

bobingham commented 3 years ago

Hi Matt, You're at a level of coding which I could only dream of. Layer Switcher is a great addition to Open Layers and I think you for your efforts. I am simply passing back what occurred during an upgrade from Angular 7 to Angular 12, any help would be greatly appreciated. I try keep my console as clean as possible so spotted this during running ng-serve.