JavaScript – Fixing ‘Cannot Use Import Statement Outside a Module’ Error in OpenLayers

javascriptopenlayers

I want to know what's mean the following error in OpenLayers

Uncaught SyntaxError: Cannot use import statement outside a module

I get this error only when I try to execute on the following example

https://openlayers.org/en/latest/examples/vector-layer.html

Best Answer

You need to get basic setup like nodejs in order to run openlayers examples.

Related Question