zerodevx / svelte-toast

Simple elegant toast notifications
https://zerodevx.github.io/svelte-toast/
ISC License
835 stars 49 forks source link

SvelteToast not defined #73

Closed JarvisStriker closed 1 year ago

JarvisStriker commented 1 year ago

I'm using Rollup with Svelte

I get this error

main.js:3 Uncaught ReferenceError: svelteToast is not defined

for this statement

import { SvelteToast } from '@zerodevx/svelte-toast'

Not sure what the problem is, all other packages are working fine.

JarvisStriker commented 1 year ago

Sorry! my bad. Had an incorrect peer dependency on Svelte. Fixed and working fine. Closing this issue

vbernabe commented 1 year ago

Hi @JarvisStriker I'm running into the same error. Can I ask how did you fix this? What peer dependency has some issues?

JarvisStriker commented 1 year ago

Hey, @vbernabe I was on a lower-svelte version. Bump it up to 3.37.0, that should work fine

vbernabe commented 1 year ago

Thanks @JarvisStriker I'm on Svelte 3.58 but still doesn't work. Can't seem to find any other errors

zerodevx commented 1 year ago

@vbernabe the command line logs should be quite verbose at hinting what went wrong - if you could paste the logs here we could help.

vbernabe commented 1 year ago

@zerodevx here is how I use the library

Import

import {SvelteToast, toast} from '@zerodevx/svelte-toast'
const options = {}

Set the component <SvelteToast {options} />

On Form Submit toast.push('Hello world!')

This is the only Error from Web Console and the page is showing a blank white screen: `Uncaught ReferenceError: svelteToast is not defined

http://localhost:8080/build/bundle.js?version=xxx:78489 [bundle.js:78489:1](http://localhost:8080/build/bundle.js?version=xxx) http://localhost:8080/build/bundle.js?version=xxx:78489` There seemed to be no other errors on the command line