I have some error with SvelteKit when I run this code :"npm run dev -- --open". It has the issuse like this: Error [ERR_REQUIRE_ESM]: require() of ES Module. I think maybe the error related to SvelteKit v1.0.0-next.199 because I tried several solutions. I also add "type": "module" in package.json, but it not work.My node version is 16.3.0. So anyone know how to remove SvelteKit?
"dependencies": {
"chart.js": "^3.6.0",
"cookie": "^0.4.1",
"moment": "^2.29.1",
"svelte-i18n": "^3.3.13"
}
Remove moment library:
npm uninstall moment --save
As explained in the comment CommonJS libs and ECMAScript6 are different standards of JavaScript libs (packing) so you need to look for ECMAScript6 (ES6) libs
Use date-fsn instead moment for example, read more about it here https://date-fns.org/
Also Svelte is compiler when you install the libs install it as dev deps:
npm install date-fns --save-dev