tbleckert / react-select-search

⚡️ Lightweight select component for React
https://react-select-search.com
MIT License
675 stars 149 forks source link

Error when using cjs module #172

Closed satanworker closed 2 years ago

satanworker commented 3 years ago

Hey! Thank you so much for such a useful library. I've found the problem with Next.js if I try to use it out of the box, the compiler gives an error because it's trying to use esm module on the server like so

Screen Shot 2021-03-03 at 13 44 47

I think the problem is it's trying to use ESM module as the main if I change package.json main property like this

Screen Shot 2021-03-03 at 13 45 36

It compiles successfully, I'm not sure, but I think that is how it suppose to work main - points to cjs module - points to esm I'm a newbie in open source, so let me know if that was helpful and if you want me to do anything else, thank you for all your work that is truly the best select for react

GabrielMochi commented 3 years ago

Same issue.

AmyAmy commented 3 years ago

Running into the same issue, created PR.