blakeembrey / change-case

Convert strings between camelCase, PascalCase, Capital Case, snake_case and more
MIT License
2.21k stars 92 forks source link

feat: update change-case package.json exports settings #327

Closed dasoncheng closed 6 months ago

dasoncheng commented 6 months ago

In certain historical Node.js versions and community build tools, dependency resolution may encounter issues.

Module not found: Error: Package path . is not exported from package **/node_modules/change-case (see exports field in **/node_modules/change-case/package.json)
blakeembrey commented 6 months ago

Can you describe which tools or versions? It’s supposed to fail if you aren’t using ESM.

Do we still need import? Why not replace it with default?

htunnicliff commented 6 months ago

@blakeembrey change-case also gives errors when using Jest in a Next.js project that is configured to support ESM.

Cannot find module 'change-case'

blakeembrey commented 6 months ago

@htunnicliff and does this fix it?

blakeembrey commented 6 months ago

Published something similar in the latest release, please let me know if that works: 5.4.0.