vadimkorr / svelte-carousel

The awesome carousel component for Svelte 3 :arrow_left: :art: :arrow_right:
https://vadimkorr.github.io/svelte-carousel
Apache License 2.0
285 stars 63 forks source link

Issue with simply-reactive #130

Closed alvissraghnall closed 1 year ago

alvissraghnall commented 1 year ago
node_modules\svelte-carousel\node_modules\simply-reactive\main.js:1
import { simplyReactive } from './src/simply-reactive'
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1033:15)
    at Module._compile (node:internal/modules/cjs/loader:1069:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:170:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
Cannot use import statement outside a module

Error generated everytime i run yarn dev and visit a route (SvelteKit). Initially the server would not start at all - something about setting kit.vite in svelte.config.js:

Error: config.kit.vite has been removed — use vite.config.js instead

Fixed that by moving the config to vite.config.ts as advised. Now, I'm lost with this simply-reactive error. Any ideas ?

webspilka commented 1 year ago

I have same error only for npm run build ((

(node:79292) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/node_modules/simply-reactive/main.js:1
import { simplyReactive } from './src/simply-reactive'
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at internalCompileFunction (node:internal/vm:74:18)
    at wrapSafe (node:internal/modules/cjs/loader:1141:20)
    at Module._compile (node:internal/modules/cjs/loader:1182:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

Node.js v18.13.0
dskelton-cos commented 1 year ago

Same issue in the REPL simplyReactive is not a function

Can't get it to run in any of my stackblitz projects, tried svelte and sveltekit, even Astro + svelte

sohzm commented 1 year ago

Adding my comment just to say if someone finds a solution please add it, it'll help

sohzm commented 1 year ago

also the repl isn't working :(

wildfluss commented 1 year ago

I've fixed that in drop-in replacement "@wildfluss/svelte-carousel": "1.0.26" works for me on vercel

vadimkorr commented 1 year ago

Fixed in svelte-carousel@1.0.23