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 code not truly standalone #2509

Open
mattfysh opened this issue Nov 22, 2024 · 0 comments
Open

Standalone code not truly standalone #2509

mattfysh opened this issue Nov 22, 2024 · 0 comments

Comments

@mattfysh
Copy link

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

  • v8.17.1
  • Yes

Ajv options object

JSON Schema

N/A

Sample data

const Error0 = require("ajv/dist/runtime/validation_error").default;

Your code

Validation result, data AFTER validation, error messages


What results did you expect?
The standalone code should be truly standalone and portable. With this require statement added, it is no longer truly standalone:

ajv/lib/compile/index.ts

Lines 120 to 125 in 69568d0

if (sch.$async) {
_ValidationError = gen.scopeValue("Error", {
ref: ValidationError,
code: _`require("ajv/dist/runtime/validation_error").default`,
})
}

Are you going to resolve the issue?

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

No branches or pull requests

1 participant