CyberChef icon indicating copy to clipboard operation
CyberChef copied to clipboard

Support current Node LTS version

Open bobbyrc opened this issue 11 months ago • 4 comments

Summary

When using any version of node 22.x and greater CyberChef errors because of a breaking change to Node starting with version 22. Node switched to using import attributes and assert needs to be swapped to the with syntax.

https://nodejs.org/docs/latest-v22.x/api/esm.html#import-attributes

Example Output

file:///srv/src/core/Recipe.mjs:7
import OperationConfig from "./config/OperationConfig.json" assert {type: "json"};
                                                            ^^^^^^

SyntaxError: Unexpected identifier 'assert'
     at compileSourceTextModule (node:internal/modules/esm/utils:338:16)
     at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:106:18)
     at #translate (node:internal/modules/esm/loader:470:12)
     at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:517:27)

bobbyrc avatar Jan 09 '25 21:01 bobbyrc

nodejs 18 is EOL:

  • End of Active Support: 18 Oct 2023
  • End of Security Support: 30 Apr 2025

EoL:

  • https://nodejs.org/en/about/previous-releases
  • https://endoflife.date/nodejs

Please support nodeJS 24 LTS

noraj avatar Jul 18 '25 00:07 noraj

ok, first of all the versions of some packages are way too old second, assert {type: "json"} is now invalid syntax for imports some flags such as --no-experimental-fetch and --experimental-json-modules are useless now

ordinary-hacker avatar Aug 12 '25 17:08 ordinary-hacker

also some packages say they are only tested for node 13, and also other old packages have security vulns that aren't fixable

ordinary-hacker avatar Aug 12 '25 18:08 ordinary-hacker

yeah this would need some work

ordinary-hacker avatar Aug 12 '25 23:08 ordinary-hacker