Skip to content

Fails to run / parse .cts source files. #3987

@Jason3S

Description

@Jason3S

Describe the bug

While working with an application with a mix of .mts and .cts files, vitest fails to correctly parse the .cts source files. It seems to be treating them as .cjs files.

image

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-xrug9w?file=README.md

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.20.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.6.10 - /usr/local/bin/pnpm
  npmPackages:
    @vitest/ui: latest => 0.34.2 
    vite: latest => 4.4.9 
    vitest: latest => 0.34.2 

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    P2 - 3

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions