Skip to content

Memfs throwing an error after update to version 3 #7266

@pjotrsavitski

Description

@pjotrsavitski

Describe the bug

Mocking filesystem with memfs as described here throws an error with version 3.

This is what I got using the example code:

Instead change the require of ...../node_modules/tslib/tslib.es6.mjs to a dynamic import() which is available in all CommonJS modules.
Error [ERR_REQUIRE_ESM]: require() of ES Module ...../node_modules/tslib/tslib.es6.mjs not supported.
Instead change the require of ...../node_modules/tslib/tslib.es6.mjs to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (...../node_modules/tree-dump/lib/index.js:3:17)

Reproduction

Vitest 3 with code from example

System Info

System:
    OS: macOS 15.2
    CPU: (12) arm64 Apple M2 Max
    Memory: 1.36 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.0 - /usr/local/bin/node
    npm: 10.9.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 131.0.6778.265
    Edge: 131.0.2903.147
    Safari: 18.2
  npmPackages:
    @vitejs/plugin-react: ^4.3.2 => 4.3.4 
    @vitest/coverage-v8: ^3.0.0 => 3.0.0 
    vite: ^6.0.7 => 6.0.7 
    vitest: ^3.0.0 => 3.0.0

Used Package Manager

npm

Validations

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