Replies: 2 comments
-
The esm package has not been touched in 2 years. So it's unlikely it recognizes the exports package json fields. I suggest you raise the issue in its issue tracker. Nevertheless i think with node being full on ESM supported in 2 lts releases (v12.20.0 tomorrow) there's no point in working on the esm module and there's 0 reason to be using it.
Native ESM or a proper ESM loader is the way. Not |
Beta Was this translation helpful? Give feedback.
-
I'm done waiting for these ecosystems to catch up. jose v4.x will be coming out today/tomorrow with only top level named exports that solve all these tools' problems. |
Beta Was this translation helpful? Give feedback.
-
When using the esm package I get "Cannot find module" when trying to import anything from jose. For example,
import SignJWT from 'jose/jwt/sign';
results inError: Cannot find module 'jose/jwt/sign'
.If I use the built in ES module import in node it works so I guess this is more of an issue with the esm package rather than this package, but do you know of any way to make it work with esm as well? Switching to native ESM is not an option right now as that breaks other stuff.
Tested this with a fresh node installation running node v15.2.1 and jose@3.1.0.
Beta Was this translation helpful? Give feedback.
All reactions