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

RudderTyper doesn't work on Node 22 #86

Open
princed opened this issue Nov 21, 2024 · 1 comment
Open

RudderTyper doesn't work on Node 22 #86

princed opened this issue Nov 21, 2024 · 1 comment

Comments

@princed
Copy link

princed commented Nov 21, 2024

RudderTyper fails with the following error when running under Node 22, which now in Active LTS status:

[...]/node_modules/rudder-typer/src/cli/index.js:18
import packageJson from '../../package.json' assert { type: 'json' };
                                             ^^^^^^

SyntaxError: Unexpected identifier 'assert'
    at compileSourceTextModule (node:internal/modules/esm/utils:340:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:102:18)
    at #translate (node:internal/modules/esm/loader:433:12)
    at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:480:27)
    at async ModuleJob._link (node:internal/modules/esm/module_job:112:19)

Node.js v22.11.0

Process finished with exit code 1

That is because assert support has been removed from Node in favour of with that is based on a more recent version of Import Attributes proposal.

If I manually change all the assert keywords to with, everything works as expected.

@akashrpo
Copy link

Hi @princed, thanks for the feedback! We'll update this to ensure compatibility with Node.js v22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants