Home > Web Front-end > JS Tutorial > Why am I getting 'Uncaught SyntaxError: Cannot use import statement outside a module' when importing ES6 modules in ArcGIS JSAPI?

Why am I getting 'Uncaught SyntaxError: Cannot use import statement outside a module' when importing ES6 modules in ArcGIS JSAPI?

Susan Sarandon
Release: 2025-01-05 00:18:40
Original
412 people have browsed it

Why am I getting

"Uncaught SyntaxError: Cannot use import statement outside a module" when importing ECMAScript 6

When attempting to use Spatial Illusions to draw military symbols on a map using ArcGIS JSAPI 4.12, one may encounter the error "Uncaught SyntaxError: Cannot use import statement outside a module" upon importing milsymbol.js. The root of this issue lies in the fact that ECMAScript 6 (ES6) modules, which use the import keyword, require the

Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template