mzohaibqc / svelte-toasts

A highly configurable notification/toast component with individual toast state management capabilities.
https://mzohaibqc.github.io/svelte-toasts/
MIT License
42 stars 6 forks source link

Unexpected token . #2

Closed vdelacerda closed 3 years ago

vdelacerda commented 3 years ago

Your works seems great and I really want to use it in my application but I have this error when I "npm run dev" :

home/virgile/Projets/virgapps/cashflow/sources/cashflow-web/node_modules/svelte-toasts/dist/svelte-toasts.js:850
            const index = get_store_value(store)?.findIndex((v) => v?.uid === uid);
                                                 ^

SyntaxError: Unexpected token .
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/virgile/Projets/virgapps/cashflow/sources/cashflow-web/__sapper__/dev/server/server.js:9:20)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
> Server crashed

Maybe some dependencies or version are required ?

vdelacerda commented 3 years ago

OK it's because optional chaining is supported since Node 14 and I use Node 10. I upgrade Node from 10 to 14 and it's OK.