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

Some toolchains fail to find module es-toolkit/compat #965

Open
tay1orjones opened this issue Feb 21, 2025 · 0 comments
Open

Some toolchains fail to find module es-toolkit/compat #965

tay1orjones opened this issue Feb 21, 2025 · 0 comments

Comments

@tay1orjones
Copy link

We replaced usages of lodash with es-toolkit/compat in our library, @carbon/react, and have found that consumers with older toolchains are encountering issues with this module, carbon-design-system/carbon#18403.

Two primary issues have been reported:

  1. Projects using jest <=v27 fail and require adding a moduleNameMapper entry to their jest config
  2. Projects using create-react-app/webpack fail to build w/ error:
    .\node_modules\@carbon\react\es\components\DataTable\Table.js
    Cannot find module: 'es-toolkit/compat'. Make sure this package is installed.
    

I think the cause is either

  • some (older) tooling lacks proper support for the exports field in package.json
  • .mjs files trip up certain toolchains module resolution for some reason

There may not be anything you can or want to do to help this situation. You're using exports correctly, it's the tooling w/ the issue. I opted to try and avoid the module resolution problems altogether by temporarily marking es-toolkit as an internal and inline what we use into our bundle, carbon-design-system/carbon#18639

Feel free to close this if you agree it's not actionable on your part. Thanks for all your work on this library! 🙏

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

1 participant