Sortable
Sortable copied to clipboard
[bug] Error when trying to import as an ES Module During SvelteKit build with Vite 3
When building a SvelteKit project using Vite 3 I get the following error:
Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
{__MY_PROJECT__}/node_modules/sortablejs/modular/sortable.core.esm.js:3782
I have tried adding "type": "module" to the package.json which resolves this error and things work properly.
Is this something that should be added? Or should I change how I'm importing this package? Currently I'm using this:
import { Sortable } from 'sortablejs/modular/sortable.core.esm.js';