Skip to content

Running tests fails with ERR_REQUIRE_ESM on Windows #2314

Description

@notaskhalsa

I ran the test suite on a clean clone using Node 18 on Windows and encountered an ERR_REQUIRE_ESM error originating from Vitest/Vite before making any changes. Let me know if there’s a recommended workaround for Windows environments.

The complete error was:
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\ .......\yup\node_modules\vite\dist\node\index.js from
C:\ ..........\yup\node_modules\vitest\dist\config.cjs not supported.
Instead change the require of index.js in C:\ ...........\yup\node_modules\vitest\dist\config.cjs to a dynamic import() which is available in all CommonJS modules.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions