Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot find module '#node-web-compat' after upgrading from 2.1.3 to 3.0.0 #67

Closed
WtfJoke opened this issue Apr 7, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@WtfJoke
Copy link

WtfJoke commented Apr 7, 2022

Describe the bug
After upgrading from aws-jwt-verify from 2.1.3 to 3.0.0 I receive following stacktrace when executing a sample jest test:

jwtVerifier.spec.ts
  ● Test suite failed to run

    Cannot find module '#node-web-compat' from '../../node_modules/aws-jwt-verify/dist/cjs/https.js'

    Require stack:
      ..../node_modules/aws-jwt-verify/dist/cjs/https.js
      ..../node_modules/aws-jwt-verify/dist/cjs/jwk.js
      ..../node_modules/aws-jwt-verify/dist/cjs/jwt-rsa.js
      ..../node_modules/aws-jwt-verify/dist/cjs/index.js

Versions
Which version of aws-jwt-verify are you using? 3.0.0
Are you using the library in Node.js or in the Web browser? Node.js
If Node.js, which version of Node.js are you using? (Should be at least 14) 14 / 17
If Web browser, which web browser and which version of it are you using?
If using TypeScript, which version of TypeScript are you using? (Should be at least 4) 4.6.3

To Reproduce
If you can, please provide a minimal code example that reproduces the bug.

Currently I dont have a minimal code example.

@WtfJoke WtfJoke added the bug Something isn't working label Apr 7, 2022
@ottokruse
Copy link
Contributor

This is an issue in Jest, see #66 on how to work around it.

Your +1 against the Jest issue would be appreciated, to (hopefully) get it prioritized: jestjs/jest#12270

@WtfJoke
Copy link
Author

WtfJoke commented Apr 7, 2022

Thanks for your fast response! I've gave the jest issue a thumbs up and going to try the solution with the moduleNameMapper.

@WtfJoke WtfJoke closed this as completed Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants