- Notifications
You must be signed in to change notification settings - Fork3.6k
Add package.json with type: module to esm directory#6897
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Conversation
Thanks for the PR. I'm going to be looking into adding proper support for this in the near future as part of a v3 release. Still taking care of some maintenance and upstream deps before doing so |
That's fantastic to hear! Let me know if you want a sounding board for any plans there, I've helped fix up several other dependencies of mine that don't quite do the right thing at the intersection of ESM/Node/TypeScript. |
reteps commentedJun 26, 2025
Any progress on this? |
See#6939 |
This is necessary for Node and similar environments to treat the contents of the
esm
directory as ES Modules. Otherwise both Node and TypeScript get quite confused.This is a step in the right direction of resolving#6797. After this change, one should be able to write the following in a TypeScript file:
Importing e.g.
react-bootstrap/ModalDialog
doesn't yet work. And the above still doesn't work at runtime because the code inesm/ModalDialog.js
isn't actually valid ESM, as it doesn't use extensions on its imports. I'd like to work towards resolving these issues in future PRs, as they're blocking the use ofreact-bootstrap
in my application.