-
Notifications
You must be signed in to change notification settings - Fork 7k
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
keycloak-js ESM does not work #30261
Comments
Can you elaborate on how "js-sha256 causes the ESM-compatible build to not work properly"? |
Sure, hopefully this helps: https://stackblitz.com/edit/vitejs-vite-pvidyi?file=README.md To be less terse and provide additional commentary to accompany the stackblitz above
While the ESM spec does say that it's fine to import CJS from ESM, in practice it causes nothing but pain for dependents. The pain is that build tooling must be given special instructions whenever a dependency is introduced that imports CJS. This might be shrugged off as not a big deal whenever someone adds ESM that imports CJS as a direct dependency. However this is pretty awful when you add a direct dependency that adds a transitive dependency that uses import statements on CJS. You end up having to document code with blurbs such as, "If you add this package as a dependency, then be sure your build tooling is updated to handle the fact that it imports CJS". And the need for such documentation becomes viral on any packages that depend on your package. |
Duplicate of #15769 |
Description
The dependency on js-sha256 causes the esm you vend to not work properly. Please consider switching libraries (eg: https://www.npmjs.com/package/@noble/hashes). It is also possible to use rollup to make an esm-compatible build of js-sha256 (eg: https://github.com/bundled-es-modules)
Filed separately: emn178/js-sha256#44
Discussion
No response
Motivation
No response
Details
No response
The text was updated successfully, but these errors were encountered: