Comments (6)
CommonJS and ESM interoperability is notoriously hard, so we'd rather stick to a standardized solution that everyone will be using in the future.
from keycloak-nodejs-admin-client.
Thanks. The transformIgnorePatterns seemed to work, but then I had to add several more node modules to the list. But, it is working ok now. Is there a reason you are not providing a CommonJS fallback? Just curious.
from keycloak-nodejs-admin-client.
"CommonJS and ESM interoperability is notoriously hard, so we'd rather stick to a standardized solution that everyone will be using in the future."
@jonkoops it's not like that, the vast majority of people/companies that are using this package still follow type commonsJS.
this answer is a bit lazy (I say this with all due respect) but making a package like this available, changing it from one moment to another, and letting everyone manage to configure their projects is a bit of bad faith.
I say this because I'm having the same problem as @kevinswarner , and our product is in production and I can't downgrade it because version 18 has a vulnerability pointed out by our sonarqube and we can't update to version ^20.0.1 because it has this "problem" with ESM, complicated.
at least we managed to fork the project
from keycloak-nodejs-admin-client.
You are using new JavaScript module syntax that is only supported when you enable it explicitly. For more information see the Node.js documentation.
from keycloak-nodejs-admin-client.
I understand that, but what I am confused about is Jest is transforming my code, and I am using "import" throughout to import other third party packages, without any issues. It is ONLY this package that is causing the error. So there is something different about THIS package that I am trying to understand so that I can figure out how to use it.
from keycloak-nodejs-admin-client.
The issue is likely due to the fact this package ships as a pure ESM library, without a CommonJS fallback. This is an issue in Jest that still needs to be resolved.
You'll either have to enable ESM mode (see documentation), or tweak transformIgnorePatterns
so that this package is transformed by Jest (see jestjs/jest#11753 (comment)).
from keycloak-nodejs-admin-client.
Related Issues (20)
- Add EvaluationResultRepresentation
- Get Multiple Users by Id HOT 1
- Add exportResource return type
- Add support for generating example IdToken and UserInfo for client-scope evaluation
- Support custom request headers injection HOT 1
- misleading 405 error when trying to delete a resource by passing undefined/null resource ID HOT 2
- Client randomly adds extraneous slashes HOT 1
- findOne by username returns multiple users in array HOT 4
- 403 Forbidden on a newly created Realm HOT 3
- users.find() also return their federated identities HOT 1
- Support oauth2DeviceAuthorizationGrantEnabled flag when creating clients HOT 1
- Poor CommonJS experience HOT 7
- Package "react-monaco-editor" not found. Have you installed it? HOT 1
- Webpack Compilation Error: "You may need an appropriate loader to handle this file type" error after upgrading to 19.0.0 HOT 2
- Error [ERR_REQUIRE_ESM] HOT 32
- Creating a Client Scope does not return the ID HOT 1
- Add support for finding groups by their path name HOT 1
- Backward compatibility to support CommonJS HOT 1
- Unable to specify roles with new user creation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keycloak-nodejs-admin-client.