node-postgres icon indicating copy to clipboard operation
node-postgres copied to clipboard

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

Open ETHANTALJAFFE opened this issue 1 year ago • 3 comments

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.

ETHANTALJAFFE avatar Aug 14 '24 14:08 ETHANTALJAFFE

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

brianc avatar Aug 14 '24 14:08 brianc

@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.

ETHANTALJAFFE avatar Aug 18 '24 10:08 ETHANTALJAFFE

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

charmander avatar Aug 19 '24 01:08 charmander

Is this still required? It's been a while and this might have gone stale. Please feel free to re-open if so (there are merge conflicts now)

brianc avatar Apr 25 '25 19:04 brianc