Skip to content

Update Scalar.AspNetCore to avoid Vue deferred Teleport failures #19834

Description

@sebastienros

Describe the bug

OrchardCore currently references Scalar.AspNetCore 2.0.0, whose embedded Scalar runtime uses Vue 3.5.12. A deferred Teleport update-before-mount ordering bug can cause Vue's patchProp to receive a VNode with el == null, throw TypeError: Cannot read properties of null (reading 'style'), and trigger Scalar's error boundary to unmount the OpenAPI reference sidebar.

A Scalar-free compiled-Vue reduction reproduces the same failure in both Chromium and Jint.Browser with Vue 3.5.12, proving this is not a Jint DOM, observer, history, or geometry defect. The same reduction passes with Vue 3.5.22.

NuGet payload inspection establishes Scalar.AspNetCore 2.12.9 as the first Scalar package containing Vue 3.5.22 or newer: it embeds Vue 3.5.26. Its immediate predecessor 2.12.8 embeds Vue 3.5.21. The Vue bump was made by scalar/scalar#7757.

Orchard Core version

Current main, with Scalar.AspNetCore centrally pinned to 2.0.0 in Directory.Packages.props.

To Reproduce

  1. Enable OrchardCore.OpenApi and OrchardCore.OpenApi.ScalarUI on a Blog tenant.
  2. Navigate to the tenant's /scalar/v1 page with the generated Blog OpenAPI schema.
  3. Allow Scalar's section IntersectionObserver callbacks to update the active fragment and Vue reactive state.
  4. Observe Vue 3.5.12 update a deferred Teleport before its mount is committed.
  5. The console/page reports TypeError: Cannot read properties of null (reading 'style'), and .references-navigation-list .sidebar is removed by Scalar's error boundary.

The exact failure was reproduced with Scalar 2.0.0's embedded assets and the full 50,869-byte Orchard Blog OpenAPI schema. Chromium and Jint.Browser both reproduce it; replacing only the Vue runtime with 3.5.22 makes both pass.

Expected behavior

Scalar should retain its reference sidebar and render/click OpenAPI operations without Vue runtime errors. Update to Scalar.AspNetCore 2.12.9 or newer, retaining Orchard's tenant-relative schema route and equivalent proxy-disable configuration.

Compatibility research indicates MapScalarApiReference, WithOpenApiRoutePattern, WithTitle, and AddHeadContent remain available. The obsolete WithProxyUrl("") call should be replaced with its equivalent WithProxy(""). The package targets net8.0, net9.0, and net10.0 and adds no extra NuGet dependencies.

Logs and screenshots

The reduced VNode lifecycle is create1/create2/create3/mount3/create4/create5 -> patch(oldVNode1.el=null) -> ScalarErrorBoundary removal -> deferred mountVNode1/2/4. The first package boundary and embedded-resource hashes were verified from actual NuGet payloads: 2.12.9 embeds Vue 3.5.26; 2.12.8 embeds Vue 3.5.21.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions