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

latest upgrade is broken with nodejs #174

Open
p3x-robot opened this issue Oct 21, 2021 · 7 comments
Open

latest upgrade is broken with nodejs #174

p3x-robot opened this issue Oct 21, 2021 · 7 comments

Comments

@p3x-robot
Copy link

https://the-guild.dev/blog/support-nodejs-esm

@p3x-robot
Copy link
Author

about 95% in nodejs/server is still using commonjs.

@pablospaniard
Copy link

pablospaniard commented Oct 26, 2021

I totally agree, you should keep library commonjs compatible as well. It is a good example of the situation when changes are done without considering community need, instead just because of "fancy" changes.

@redevill
Copy link

To be a little more specific: (for simple folk like me ;))
V5.0.3 using the stated import: "import dateFormat from "dateformat";"
Results in a runtime error of "Must use import to load ES Module:" in a nodejs typescript environment.

Moving back to V4.6.3 rectifies this runtime error.

@p3x-robot
Copy link
Author

crazy, over update everything (and break) and nodejs is basically commonjs in 99%, so non-considerate

@chase-manning
Copy link
Collaborator

If anyone wants to change the package, feel free to create a PR 😃

@redevill
Copy link

Been trying to become "less simple" - Drinking from the Firehouse. So a PR attempt might have success.

So Far:
In Summary this guy highlights the various pitfalls, and makes a good case for hybrid supporting both CommonJs and ESM.
https://www.sensedeep.com/blog/posts/2021/how-to-create-single-source-npm-module.html

@armtuk
Copy link

armtuk commented Apr 6, 2022

It doesn't work out of the box with a standard react-app, I'm curious why more folks haven't run into this.

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

5 participants