zerodevx/svelte-toast

SvelteToast not defined

JarvisStriker opened this issue · 6 comments

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.

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

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

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

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

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

@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 <anonymous> http://localhost:8080/build/bundle.js?version=xxx:78489 [bundle.js:78489:1](http://localhost:8080/build/bundle.js?version=xxx) <anonymous> http://localhost:8080/build/bundle.js?version=xxx:78489

There seemed to be no other errors on the command line