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-4 produces invalid code #96

Closed
keean opened this issue Dec 21, 2020 · 1 comment
Closed

ajv-4 produces invalid code #96

keean opened this issue Dec 21, 2020 · 1 comment

Comments

@keean
Copy link

keean commented Dec 21, 2020

ajv-4 fails to generate valid code, as it generates multiple definitions for the same function, which is causing a problem with Rollup. (ajv-3 worked fine on the same json schema file). I have enabled --code-lines to make the error readable:

1142:
1143:
1144: function validate26(data, {dataPath="", parentData, parentDataProperty, rootData=data}={}){
^
1145: let vErrors = null;
1146: let errors = 0;
SyntaxError: Identifier 'validate26' has already been declared (1144:9) in /...

In this case there are multiple definitions of "validate26". Initial inspection suggests that both definitions are identical, however it is still illegal to define the same function twice.

I am happy to help debug this, but I don't know what further information you might need.

@epoberezkin
Copy link
Member

It's been fixed in Ajv 7.0.2 - please update (npm update should do it - or re-install).

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