Repository navigation
Conversation
…ns of ajv package JIRA: CPOUI5FOUNDATION-1374 Upport of: SAP/ui5-project#887 `@ui5/project` registers the `ajv-errors` plugin on its `Ajv` instance, but `ajv-errors` imports its **own** copy of `ajv` at load time instead of using the instance it's given. When a consumer's tree has two `ajv` copies, the two bind to different module instances, AJV's `instanceof`-based codegen breaks, and `ui5 build` crashes (`SyntaxError: Unexpected token ':'` — see [ajv-validator/ajv-errors#157](ajv-validator/ajv-errors#157)). We can't fix this from the consumer side since `@ui5/project` is itself a dependency. Vendoring `ajv-errors` **inside** `@ui5/project` makes its `require("ajv")` resolve to the **same `ajv`** that `validator.js` uses — one module instance, so the mismatch can't happen regardless of the consumer's dependency tree. Follows the existing `serve-index` fork precedent; temporary until upstream lets consumers inject `ajv`.
d3xter666
marked this pull request as draft
October 8, 2026 14:24
d3xter666
marked this pull request as ready for review
October 8, 2026 14:46
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JIRA: CPOUI5FOUNDATION-1374
Upport of: SAP/ui5-project#887
@ui5/projectregisters theajv-errorsplugin on itsAjvinstance, butajv-errorsimports its own copy ofajvat load time instead of using the instance it's given. When a consumer's tree has twoajvcopies, the two bind to different module instances, AJV'sinstanceof-based codegen breaks, andui5 buildcrashes (SyntaxError: Unexpected token ':'— see ajv-validator/ajv-errors#157). We can't fix this from the consumer side since@ui5/projectis itself a dependency.Vendoring
ajv-errorsinside@ui5/projectmakes itsrequire("ajv")resolve to the sameajvthatvalidator.jsuses — one module instance, so the mismatch can't happen regardless of the consumer's dependency tree. Follows the existingserve-indexfork precedent; temporary until upstream lets consumers injectajv.