Bug report: Node API breaks on crypto-api import
Issue raised on crypto-api repo to fix: https://github.com/nf404/crypto-api/issues/12
The current release of the Node API is only tested against Node LTS, so v10.13.0. We need that crypto-api fix to make it compatible with other versions, but I'll document valid versions of Node somewhere
I'll correct myself: the current cyberchef release throws the same ERR_REQUIRE_ESM error if you require it.
There is a workaround if the consuming application uses esm, which is to import the source index:
import chef from "cyberchef/src/node/index"
I assume that conforms with what you experienced?
After #600 was merged you should now be able to use top-level imports up to and including node v12. Named imports still do not work with v12 for the same reason we got before.
We now have a hacky fix to add the extensions ourselves: https://github.com/gchq/CyberChef/blob/9088561acf75fce6961efda2ed276f3f15b9bf04/Gruntfile.js#L413-L416