GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(windows): break import cycle between view and animation modules by aleclarson · Pull Request #11581 · NativeScript/NativeScript

Conversation

@aleclarson

@aleclarson aleclarson commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • view-common imports Animation from ui/animation, whose Windows index imported _ensureNativeTransforms back from the platform view barrel (ui/core/view/index) — a view-common → animation → view → view-common cycle that does not exist on Android (index.android.ts has no such import).
  • When the bundler (Vite/rolldown) flattens both modules into one chunk it evaluates the platform View class body — [originXProperty.setNative], [isEnabledProperty.setNative], etc. — before view-common's property declarations run, so the app crashes at startup with TypeError: Cannot read properties of undefined (reading 'setNative'). Under plain ESM evaluation the same cycle produces a TDZ error.
  • Moves _ensureNativeTransforms into a leaf module (native-transforms.windows) imported by both files; it only touches WinRT types, so the edge from animation back into the view module disappears. The public re-export from ui/core/view is preserved (.d.ts unchanged in shape — _ensureNativeTransforms remains exported from the same specifier).

Test plan

  • tsc --noEmit -p packages/core/tsconfig.lib.json — clean
  • Rebuilt an Octane Xplat Windows app (@nativescript/core@abae298 + this change applied as a patch): generated vendor.mjs no longer references the uninitialized binding; the packaged app boots past module evaluation
  • apps/toolbox Windows run

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aleclarson
fix(windows): break import cycle between view and animation modules
8c98608
view-common imports Animation from ui/animation, whose Windows index
imported _ensureNativeTransforms back from the platform view barrel.
When the bundler flattened both modules into one chunk it evaluated the
platform View class body — [originXProperty.setNative] and friends —
before view-common's property declarations ran, so the app crashed at
startup with 'Cannot read properties of undefined (reading setNative)'.

Move _ensureNativeTransforms into a leaf module (native-transforms)
imported by both files; it only touches WinRT types, so the edge from
animation back into the view module disappears. The public re-export
from ui/core/view is preserved.
@nx-cloud

nx-cloud Bot commented Oct 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 8c98608

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 51s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded 7s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-23 20:42:48 UTC

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pkg-pr-new

pkg-pr-new Bot commented Oct 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11581
npm i https://pkg.pr.new/@nativescript/vite@11581
npm i https://pkg.pr.new/@nativescript/webpack@11581

commit: 8c98608

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@NathanWalker
NathanWalker merged commit 85a23d7 into NativeScript:feat/windows Oct 28, 2026
7 checks passed

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@aleclarson @NathanWalker
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.