mattjennings / svelte-modals

A simple, flexible, zero-dependency modal stack manager for Svelte.
https://svelte-modals.mattjennings.io
154 stars 8 forks source link

Modals don't show when using Routify and/or Capacitor #4

Closed Zettexe closed 3 years ago

Zettexe commented 3 years ago

Describe the bug I tried using svelte-capacitor template and adding svelte-modals but the modals don't seem to work at all and without error messages

Reproduction

  1. git clone https://github.com/drannex42/svelte-capacitor
  2. npm install
  3. npm install svelte-modals
  4. Add basic examples from svelte-modals readme
  5. npm run dev:start
mattjennings commented 3 years ago

I just ran into this yesterday. There's a Vite bug that causes this but the work around is to add this to your vite.config.js:

  optimizeDeps: {
    exclude: ['svelte-modals'],
  }
Zettexe commented 3 years ago

Yep, seems to work just fine with that included

mattjennings commented 3 years ago

awesome. This is the particular issue if you're curious, but vite-plugin-svelte will hopefully automate this soon as a temporary workaround.