awslabs / aws-jwt-verify

JS library for verifying JWTs signed by Amazon Cognito, and any OIDC-compatible IDP that signs JWTs with RS256, RS384, and RS512
Apache License 2.0
606 stars 42 forks source link

Actually support Node12 or update the docs to mention support for Node14 and above #23

Closed ottokruse closed 2 years ago

ottokruse commented 2 years ago

Running the lib on Node12 raises:

/<path>/node_modules/aws-jwt-verify/dist/cjs/jwt-rsa.js:284
        return new this(verifyProperties, additionalProperties?.jwksCache);
                                                               ^
SyntaxError: Unexpected token '.'

This is because this project's tsconfig.json extends from "@tsconfig/node14/tsconfig.json". To support Node12 it should of course be extended from "@tsconfig/node12/tsconfig.json"

rpawlaszek commented 2 years ago

+1 for Node12

ottokruse commented 2 years ago

After a closer look we've seen we're already using a number of feature that were introduced in Node 13 (e.g. use a function as a destination in a stream.pipeline). As Node12 is now in maintenance mode, and this being a new library, and new usage will probably be on Node 14+, it seems unwarranted to undertake effort to support Node12. Therefore we decided for Node14 to be the minimum, changed the docs accordingly in #25

OrHaiLevy commented 2 years ago

Reporting that I still get the same error on node v14.18.1, v16.0.0, v16.13.1 (Macbook M1).

ottokruse commented 2 years ago

Still getting that @OrHaiLevy ? Do you get the exact same error message mentioned in the 1st comment of this issue?

akorkot commented 2 years ago

I changed the runtime of my lambda in my SAM Template from "nodejs12.x" to "nodejs14.x" and it works!

ttran13 commented 10 months ago

Hi, I am still getting this error after updating from Node 13 to Node 14, 16, and 18. The app is ran in an EC2 instance. It is the exact same error message even after rebooting the instance as well as attempting to restart the app. Any advice would be greatly appreciated.

ottokruse commented 10 months ago

@ttran13 best log a new issue with complete stack trace and ideally steps to reproduce