Skip to content

ESM errors due to require of sub-package #182

@crutchcorn

Description

@crutchcorn

When running a new project with JSDom via Vitest, I get the following error:

Error: require() of ES Module C:\Users\crutchcorn\git\TanStack\form\node_modules\.pnpm\@asamuzakjp+css-color@2.8.2\node_modules\@asamuzakjp\css-color\dist\esm\css-color.min.js from C:\Users\crutchcorn\git\TanStack\form\node_modules\.pnpm\cssstyle@4.2.1\node_modules\cssstyle\lib\parsers.js not supported.

This appears to be because:

4.2.0 introduced @asamuzakjp/css-color, which seems to be packaged incorrectly for ESM usage in this PR:

#171

I'll make an issue upstream to https://github.com/asamuzaK/cssColor to try and suggest some changes there, but wanted to flag here since it appears to affect many JSDom projects as-is

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