walkermatt / ol-layerswitcher

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

TypeError: Cannot read properties of undefined (reading 'control') #505

Open predefinedx opened 1 month ago

predefinedx commented 1 month ago

Hi!

So for a fair while now, I'm getting an error in console, when using ol-layerswitcher package image

Which points to this line in node_modules\ol-layerswitcher\dist\ol-layerswitcher.js- image

Everything seems to work as intended, but this error in console is there at all times (even when I'm not in the part of the app, that has map involved). Is this a problem on my end? If it is- what could cause the issue? If it's not a common issue, can someone provide me with a working example, which does not produce this error? Giving an minimal reproduction from my side would be quite difficult, but if it will be needed, i can try to invest time to create an minimal reproduction.

Thank you all in advance!