Closed jpbelang closed 2 years ago
As an aside, swc
compiles the code correctly.
Thanks for taking the effort of reporting this issue and providing code to reproduce it!
I'm not an expert around this, but navigating through IntelliJ, CognitoJwtVerifier.create() seems to go in dist/cjs, where CognitoJwtVerifierSingleUserPool seems to come from dist/esm.
Yeah that is weird and seems to be the issue, we'll dive in this.
For the time being, this works too:
import {
CognitoJwtVerifierSingleUserPool,
CognitoJwtVerifier,
} from "aws-jwt-verify/cognito-verifier";
Fixed in v2.1.1
Describe the bug I wanted to declare a type for a verifier like this:
But compilation returns an error:
Versions Which version of
aws-jwt-verify
are you using? 2.1.0Which version of Node.js are you using? (Should be at least 14) 14.17.1
If using TypeScript, which version of TypeScript are you using? (Should be at least 4) Version 4.5.5
To Reproduce Just declaring a type seems to cause the problem. I have a repo for reproduction: https://github.com/jpbelang/aws-jwt-verify-check
I'm not an expert around this, but navigating through IntelliJ,
CognitoJwtVerifier.create()
seems to go indist/cjs
, whereCognitoJwtVerifierSingleUserPool
seems to come fromdist/esm
.I can cheat by importing something that seems wrong:
import {CognitoJwtVerifierSingleUserPool} from "aws-jwt-verify/dist/cjs/cognito-verifier";