Skip to content

Vitest issue due to missing export field in package.json #153

@Thrudd

Description

@Thrudd

Hello, I've been trying to use various uiwjs packages in my app that uses Vitest. I ran into this issue where Vitest incorrectly tries to load the cjs version rather than the esm: vitest-dev/vitest#4233

It seems the fix is to simply add exports to the package.json like so:
"exports": {
"require": "./cjs/index.js",
"import": "./esm/index.js"
},

The same applies to react-colour-name. I haven't tried other uiwjs packages but expect they could fall foul of the same issue.

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