SortableJS / Sortable

Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.
https://sortablejs.github.io/Sortable/
MIT License
29.78k stars 3.7k forks source link

Uncaught SyntaxError: Cannot use import statement outside a module (at #2252

Open triumphhub opened 1 year ago

triumphhub commented 1 year ago

Hello Forum,

I downloaded code via npm and am using the following code from this site. `

` Using this code, I get the following errors `Uncaught SyntaxError: Cannot use import statement outside a module (at (index):1:9) (index):9 Uncaught ReferenceError: nestedSortables is not defined at (index):9:21` I am trying to use the "Nested Sortables Example" from this site and expect to see a sortable list. Thank you for any help
trasherdk commented 1 year ago

<script type="module" src="main.js"></script>

triumphhub commented 1 year ago

Thank you trasherdk,

What is the import for if it doesn't work?