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

fix - Removed import and usage of nodeCrypto when not running on nodejs #3296

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ETHANTALJAFFE
Copy link

Following this discussion I implemented the suggested solution.

Removing the nodeCrypto check inside of md5 function because we anyway only export utils-webcrypto when we're in the correct environment.

@brianc
Copy link
Owner

brianc commented Aug 14, 2024

Looks like the tests are dying with an 'unrecognized algorithm name' in node:

https://github.com/brianc/node-postgres/actions/runs/10389540544/job/28768489773?pr=3296#step:8:580

Copy link
Collaborator

@charmander charmander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the comment in the existing code said,

Note that the MD5 algorithm on WebCrypto is not available in Node.js. This is why we cannot just use WebCrypto in all environments.

@ETHANTALJAFFE
Copy link
Author

@brianc ok I think the reason is because we are checking for node 15 even though node.js only started support webCrypto starting version 22

I am gonna try and change the if statement to check node 22 instead of 15.

@charmander
Copy link
Collaborator

Node 15 is correct. Even the version history on the Node 22 docs page mentions versions back to 16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants