Skip to content

dlg.showModal is not a function #1756

@LouBen3010

Description

@LouBen3010

Describe the bug

When testing our application with Vitest 3.2.4 the tests are failing with an exception stating that dlg.showModal()is not a function. Although, when I navigate to this code, VS Code tells me, that this is indeed a function.

Image

Reproduction

  1. Create a new Vitest test
  2. Render a page containing a modal
  3. Trigger the opening of the modal

Version and System Info

System:
    OS: macOS 15.6.1
    CPU: (12) arm64 Apple M3 Pro
    Memory: 75.80 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.19.4 - ~/.nvm/versions/node/v20.19.4/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.19.4/bin/npm
    pnpm: 10.15.1 - /opt/homebrew/bin/pnpm
  Browsers:
    Brave Browser: 135.1.77.97
    Chrome: 139.0.7258.157
    Safari: 18.6
  npmPackages:
    @sveltejs/kit: ^2.36.3 => 2.36.3 
    flowbite-svelte: ^1.13.7 => 1.13.7 
    svelte: ^5.38.6 => 5.38.6 
    vite: ^7.1.2 => 7.1.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproductionIssue needs a minimal code example to reproduce the reported problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions