panva / openid-client

OAuth 2 / OpenID Connect Client API for JavaScript Runtimes
MIT License
1.83k stars 392 forks source link

Module '"crypto"' has no default export #291

Closed brianpooe closed 4 years ago

brianpooe commented 4 years ago

Screenshot 2020-09-14 at 18 27 04

Expected behaviour Not throw an error when program starts.

Environment: Nestjs 7 "openid-client": "^4.1.0", node v12.18.3

Additional context Add any other context about the problem here.

panva commented 4 years ago

Might be a tooling issue. Based on what's in the issue i can't help, nor can i reproduce.

brianpooe commented 4 years ago

Thanks for the swift response but not sure what you mean by tooling, this is a nodejs environment and dependencies are built the same throughout its framework counterparts. If it helps this is typescript.

But i noticed your library does support types so not sure what is the issue.

panva commented 4 years ago

I’m no ts expert but both jose (in its types) and crypto (through @types/node) do have default exports.

Hence me saying this is likely a tooling issue on your end, a tsconfig one maybe?

panva commented 4 years ago

I've pushed a small change, see if it helps.

brianpooe commented 4 years ago

I was about to do a pull request for this. Thanks.