-
Notifications
You must be signed in to change notification settings - Fork 703
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
add module field to package.json for ES Module imports #384
add module field to package.json for ES Module imports #384
Conversation
@jackmoore Hey, been 3+ months so just gonna ping you if that's alright |
This seems fine, thanks! My apologies for the very late response. |
Awesome thanks :)! |
How are you guys?, Great job with the lib but this improvement is creating an error when developing locally. const autosize = require('autosize');
autosize(myObject); Is throwing this error locally because it should have been
In production is ok but locally fails. This is happening in a library inside another library that I am using, so changing this will be a bigger problem that rollbacking this change, what you guys think? |
I created a PR to revert the changes if you guys consider it should be reverted |
@jpacareu-meli Thanks for letting me know. I reverted the minor version and made a new release, then added back the module field as a major version. That should spare the library that you are using assuming they respect semver. Sorry about the breaking change! |
For context, I believe this issue is related webpack/webpack#4742 The creator of the issue also ran into this problem, and is asking for webpack to provide some interop. I know Typescript tsconfig.json also allows this with esmoduleInterop https://www.typescriptlang.org/tsconfig/#esModuleInterop , might be interesting to read that for context. I tend to always use it when I have a TS project. Apologies for proposing the change without considering this issue between CJS/ESM, the different NodeJS module syntaxes can be ... quite a shitshow.. |
haha is ok man, things would be ok now when the 4.0.4 version is released. Your changes are now in v5.x.x :D |
Hi!
I used to import autosize in my project like:
Which works fine. Then I switched to Typescript and installed @types/autosize, but this only works for me if I import like:
But that only works if there is either:
Just adding the module field and pointing it to
src/autosize.js
would work great.I've taken the liberty to also bump and add a changelog entry since I couldn't find contribution guidelines or any signs of an automated publish step that does this. Hopefully that's okay 😅 .
Kind regards,
Joren