Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Thrudd opened this issue Sep 11, 2024 · 2 comments
Open

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

Thrudd opened this issue Sep 11, 2024 · 2 comments

Comments

@Thrudd
Copy link

Thrudd commented Sep 11, 2024

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.

@syedmaazsaeed
Copy link

Can I fix this Issue? I am a Full-Stack Software Developer and work with various Tech Stack like MERN , NEXT , REACT , FLUTTER, C#.

@jaywcjlove
Copy link
Member

@syedmaazsaeed You're welcome to submit a PR, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants