Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toast does not work #28

Open
ambarvm opened this issue Sep 14, 2021 · 3 comments
Open

Toast does not work #28

ambarvm opened this issue Sep 14, 2021 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@ambarvm
Copy link

ambarvm commented Sep 14, 2021

The component does not show toast. Tried in sveltekit app and create-vite svelte app.

Steps to reproduce

  1. Create a blank sveltekit app pnpm init svelte@next my-app
  2. Copy example from readme to routes/index.svelte
  3. Run pnpm dev
  4. See error
500

String.prototype.startsWith called on null or undefined

TypeError: String.prototype.startsWith called on null or undefined
    at startsWith (<anonymous>)
    at node:internal/errors:811:19
    at Array.filter (<anonymous>)
    at node:internal/errors:809:16
    at prepareStackTrace (node:internal/errors:96:12)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:38)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
  1. Refresh and button appears. Clicking button does not show toast.

Code available in https://github.com/supercoww/svelte-notifications-repro

System info

Windows 10
Node 16.6.0
pnpm 6.14.7

@ambarvm
Copy link
Author

ambarvm commented Sep 15, 2021

The component works after adding '@beyonk/svelte-notifications' to optimizeDeps.exclude in vite config. The String.prototype.startsWith error still appears in sveltekit.

@antony
Copy link
Member

antony commented Nov 1, 2021

Interesting. I've not used it with SvelteKit yet but plan to very soon. It sounds like we're doing something which isn't fully ejs compliant.

@antony antony added the help wanted Extra attention is needed label Nov 1, 2021
@tojofo
Copy link

tojofo commented Nov 10, 2021

The component works after adding '@beyonk/svelte-notifications' to optimizeDeps.exclude in vite config. The String.prototype.startsWith error still appears in sveltekit.

FWIW I was not getting an error but notifications were not displaying. Doing the above addressed the issue for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants