Skip to content

[Bug]: transformIgnorePatterns is not considered for files transformations #15781

@malopgrics

Description

@malopgrics

Version

30.0.5, also reproduced with 29.7.0

EDIT :

With the suggestions provided by @hainenber , it is now a windows-only problem. It works fine in WSL. It still is a problem.

Steps to reproduce

  1. Clone my reproduction repo
  2. run npm ci to install dependencies
  3. run npm run test
  4. Error comes up : "SyntaxError : Cannot use import statement outside a module"

Expected behavior

the package @vueuse/core should be transformed, according to the value of transformIgnorePatterns in jest.config.js.

Actual behavior

Jest fails with SyntaxError when importing @vueuse/core` It works in the other test when importing loadash

Additional context

I reproduces babel and jest configurations from the project I work on, but all with the latest versions.

Maybe related to issue #15728 ?

Environment

System:
   OS: Windows 11
Binairies:
   node: 22.16.0
   npm: 11.4.1
npmPackages:
   @babel/plugin-transform-runtime: 7.28.0
   @babel/preset-env: 7.28.0
   @babel/runtime-corejs3: 7.28.2
   @vueuse/core: 13.6.0
   babel-jest: 30.0.5
   jest-environment-jsdom: 30.0.5
   jest: 30.0.5
   lodash: 4.17.21

Also with the same npmPackages on WSL2

System:
   OS: 6.6.87.2-microsoft-standard-WSL2
Binairies:
   node: 22.18.0
   npm: 11.5.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions