Skip to content

Standalone code not truly standalone #2509

@mattfysh

Description

@mattfysh

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions