beyonk-group / svelte-notifications

Svelte toast notifications component that can be used in any JS application
311 stars 24 forks source link

Does it support typescript? #25

Open shaozi opened 3 years ago

shaozi commented 3 years ago

I use typescript with Sveltekit and it gives run time error:

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: .../node_modules/@beyonk/svelte-notifications/index.js
require() of ES modules is not supported.
metayii commented 3 years ago

I get this error even in JS, not TS.

antony commented 3 years ago

This is a vite thing. You probably need to install it in devDeps, or not devDeps. whatever works.

v79 commented 1 year ago

I find it works with Typescript, but VSCode doesn't like the options parameter.

notifier.danger('Error saving: ' + error, { persist: true });

VSCode underlines { persist: true} because I haven't supplied a number for the duration.

I wish there was more control over positioning/styling. I may have to fork this.