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

"ajv compile --code-esm" outputs "error: parameter --code-esm is unknown" #236

Open
matthewcornell opened this issue Jun 28, 2023 · 3 comments

Comments

@matthewcornell
Copy link

Hi Folks. I'm trying to compile my schema to an ES module, but my command npx ajv compile --code-esm -s src/schema.json -o src/validate.js prints error: parameter --code-esm is unknown in spite of that option being documented at https://ajv.js.org/standalone.html :

Set the code.esm (JS) value to true or pass the --code-esm (CLI) flag if you want ESM exported code.

Running that command without --code-esm prints schema src/schema.json is valid and generates src/validate.js, which shows my inputs are otherwise ok.

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

  • "ajv": "^8.12.0"
  • "ajv-cli": "^5.0.0"
  • npm --version # 9.5.0
  • node --version # v18.15.0

Note that running npm install --save-dev ajv resulted in version 6.12.6 being installed (!), so I had to manually run npm install --save-dev [email protected] to get the latest version. Maybe I screwed something up?

What results did you expect?
Output with no error.

@matthewcornell
Copy link
Author

Oops - I think this should have gone into https://github.com/ajv-validator/ajv-cli . created: #234 . Sorry about that.

@matthewcornell
Copy link
Author

I haven't had a response to the linked-to issue. Does anyone have any advice about this? Thank you.

@matthewcornell matthewcornell reopened this Jul 3, 2023
@epoberezkin epoberezkin transferred this issue from ajv-validator/ajv Jul 29, 2023
@epoberezkin
Copy link
Member

I don't think it was ever supported.

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

No branches or pull requests

2 participants