-1

I'm building an extension for a CMS (directus) and one of the dependencies @aws-sdk/client-quicksight is trying to use a module that is not supported (crypto). I get crypto.getRandomValues() not supported as an error from the CMS' logs;

How can I use @aws-sdk/client-quicksight in nodejs?

carlinhop
  • 1
  • 2
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Sep 15 '22 at 16:33

1 Answers1

0

I found an answer from a similar problem that another library had: https://github.com/jsdom/jsdom/issues/1612

Basically add this so the dependency can find crypto:

import { Crypto } from "@peculiar/webcrypto"

global.crypto = new Crypto()
carlinhop
  • 1
  • 2