Skip to content

exported vitest members are auto imported in app if referenced within a callback #516

Description

@christianlime

Describe the bug

If any auto import keywords are referenced as defined variable in a callback, an error is thrown

e.g. vitest exports it, and if we have const filteredArr = arr.filter((it) => it.data) within our app, an error is thrown.

On our side we can fix by renaming it to anything else, but it was a little bit of an investigation to find it out.

Linked is a simple devbox reproducing the error

Reproduction

https://codesandbox.io/p/sandbox/autoimport-bug-nxn56h

System Info

n/a

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions