CyberChef icon indicating copy to clipboard operation
CyberChef copied to clipboard

Bug report: Node API breaks on crypto-api import

Open n1474335 opened this issue 7 years ago • 4 comments

Issue raised on crypto-api repo to fix: https://github.com/nf404/crypto-api/issues/12

n1474335 avatar Jul 09 '19 13:07 n1474335

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

d98762625 avatar Jul 10 '19 13:07 d98762625

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?

d98762625 avatar Jul 12 '19 19:07 d98762625

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.

d98762625 avatar Aug 16 '19 13:08 d98762625

We now have a hacky fix to add the extensions ourselves: https://github.com/gchq/CyberChef/blob/9088561acf75fce6961efda2ed276f3f15b9bf04/Gruntfile.js#L413-L416

C85297 avatar Apr 27 '26 15:04 C85297