"@kinde-oss/kinde-node-express" doesn't support module js project
Hi I am trying to validate a user token send from my react frontend appliction to the node express server. My node express server is written module js and use named imports. But it seems like named imports doesn't supports by the "@kinde-oss/kinde-node-express" can someone guide me to fix this issue
8 Replies
Hi @akl_isu,
It looks like you're encountering an issue with named imports due to the
@kinde-oss/kinde-node-express
package being a CommonJS module. In Node.js, especially with ES modules (type: "module"
in your package.json
), you might face compatibility issues when trying to use named imports directly from CommonJS modules.
To resolve this issue, you should import the entire module as a default import and then destructure the needed functions from it. Here's how you can modify your import statement:
This change should allow you to correctly import and use the getUser
and setupKinde
functions from the @kinde-oss/kinde-node-express
package in your Node.js application using ES modules.
Please let me know if you are still experiencing issues.Hi @Oli - Kinde I am still facing to same issues with the default import also
Hey @akl_isu,
Apologies, this message slipped beneath the cracks in my Discord. Are you still experiencing this issue?
Yes actually I tried kindle for academic project, I found a another implementation for the authentication. However I am still facing to issue
Hey @akl_isu,
This is good context to know.
Our Express SDK takes a little longer than usual to update.
I have passed this onto my team but I cannot provide any ETAs on when this issue will be fixed.
Apologies.
No worries, anyway I really liked the React Implementation it's so convenient
Thanks for the feedback