Skip to content

vite-plugin-istanbul fails with "minimatch is not a function" due to test-exclude import incompatibility #355

Description

@sunil-techverito

Describe the bug

When using vite-plugin-istanbul with minimatch v3.x, the plugin throws an error:
Internal server error: minimatch is not a function
This is caused by test-exclude importing minimatch as { minimatch } = require('minimatch'), but minimatch v3 exports the function directly. The error occurs at test-exclude/index.js:98 when calling minimatch(...).

Reproduction

Vite should start without errors and code coverage should work

Steps to reproduce

Install vite-plugin-istanbul and minimatch@3.x.
Start Vite.
Observe the error in the console.

System Info

Nothing

Used Package Manager

yarn

Logs

Update the import in test-exclude to:
const minimatch = require('minimatch');
Or ensure compatibility with minimatch v3.x

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions