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

Standalone esm option --code-esm is not recognized #2354

Open
nsheff opened this issue Dec 14, 2023 · 1 comment
Open

Standalone esm option --code-esm is not recognized #2354

nsheff opened this issue Dec 14, 2023 · 1 comment

Comments

@nsheff
Copy link

nsheff commented Dec 14, 2023

What version of Ajv are you using? Does the issue happen if you use the latest version?

[email protected]

The docs say:

pass the --code-esm (CLI) flag if you want ESM exported code.

But when I do this:

ajv compile -s numeric.json --code-esm -o validate_schema.js

It gives this error:

error: parameter --code-esm is unknown

Indeed, in ajv help compile, there is no option listed for --code.esm. So, the documentation here is incorrect: https://ajv.js.org/standalone.html

Maybe related to #2209 -- is ESM module generation not working, and so the CLI option has been removed?

@jasoniangreen
Copy link
Collaborator

jasoniangreen commented Jun 22, 2024

It looks like this option is simply not supported, but I can see a promising PR that adds it in. I will follow up.
ajv-validator/ajv-cli#200

This will either be an enhancement or it's just that the docs are wrong.

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

No branches or pull requests

3 participants
@jasoniangreen @nsheff and others