Open 5o50 opened 1 week ago
I've switched to using this instead
import crypto from 'crypto';
global.crypto = crypto
with global.crypto = require('crypto');
the require()
is messing with ES module scope
@jayair @thdxr can you reproduce the issue ?
node: 18.18.2 sst: 3.1.10
Hello
In my lambda function crypto is well defined and I can use it without problem only when I call
bus.publish()
I get the following error.It seems related to aws4fetch specifically to https://github.com/mhart/aws4fetch/issues/61
After some tests I've found that adding
global.crypto = require('crypto');
to the top of sst/aws/bus.js fix the issueWe could integrate this fix until aws4fetch figure it out that would make Bus usable