Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support current Node LTS version #1960

Open
bobbyrc opened this issue Jan 9, 2025 · 0 comments
Open

Support current Node LTS version #1960

bobbyrc opened this issue Jan 9, 2025 · 0 comments

Comments

@bobbyrc
Copy link

bobbyrc commented Jan 9, 2025

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant