Skip to content

Re-run cannot be triggered by files imported by import.meta.glob with raw #2919

Closed
@sxzz

Description

@sxzz

Describe the bug

Consider the code below

const results = import.meta.glob('./*.txt', {
  as: 'raw', 
  eager: true,
})
console.log(results)

It will not re-run after changing foo.txt. But if removes as: 'raw' it just works.

Reproduction

https://github.com/sxzz/vitest-glob-test

nr test and modify tests/a.txt

System Info

System:
    OS: macOS 13.2.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 3.63 GB / 32.00 GB
    Shell: 3.6.0 - /opt/homebrew/bin/fish
  Binaries:
    Node: 18.14.0 - ~/Library/Caches/fnm_multishells/18655_1677326277920/bin/node
    Yarn: 1.22.19 - ~/Library/pnpm/yarn
    npm: 9.3.1 - ~/Library/Caches/fnm_multishells/18655_1677326277920/bin/npm
  Browsers:
    Chrome: 110.0.5481.177
    Chrome Canary: 113.0.5616.0
    Firefox: 109.0
    Safari: 16.3
    Safari Technology Preview: 16.4
  npmPackages:
    vite: ^4.1.4 => 4.1.4 
    vitest: ^0.29.1 => 0.29.1

Used Package Manager

pnpm

Validations

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