Skip to content

Xcode 26.3 / iOS device startup crash on NativeScript 8.9.x: UIContentSizeCategoryExtraSmall is not defined #11135

Closed

Description

@jpmartinsson

Issue Description

Description

After upgrading to Xcode 26.3, a NativeScript 8.9.x Angular app crashes during startup on a physical iPhone when launched from Xcode.

The crash happens before app code really starts and appears to come from NativeScript core/iOS runtime startup.

Environment

  • NativeScript CLI: 8.9.4-next-09-04-2025-17475697620
  • @nativescript/core: 8.9.3-next-05-28-2025-15305824880
  • @nativescript/ios: 8.9.2-next.2025-02-28-13593660746
  • @nativescript/angular: 15.0.2
  • Node: 20.20.1
  • npm: 9.5.0
  • Xcode: 26.3
  • Device: iPhone 16 Pro
  • iOS: 26.3.1

Expected behavior

App should start normally on device when built/launched with Xcode 26.3.

Actual behavior

App crashes during NativeScript startup.

First crash:

ReferenceError: UIContentSizeCategoryExtraSmall is not defined

Stack begins in:

  • @nativescript/core/accessibility/font-scale.ios.js
  • @nativescript/core/accessibility/accessibility-css-helper.js
  • @nativescript/core/application/application-common.js

Additional investigation

I verified the bundled vendor.js contains a direct reference to:

[UIContentSizeCategoryExtraSmall, 0.5]

I then patched @nativescript/core/accessibility/font-scale.ios.js locally to remove direct UIContentSizeCategory... global references. After that, startup progressed further but failed with a second error:

ReferenceError: Cannot access 'Application' before initialization

Stack begins in:

  • @nativescript/core/media-query-list/index.js

This suggests there may be broader NativeScript 8.x startup/runtime compatibility issues with Xcode 26.3, with UIContentSizeCategoryExtraSmall just being the first visible failure.

Reproduction steps

  1. Open project in Xcode 26.3
  2. Build/run on physical iPhone
  3. Observe startup crash

If helpful I can try reproducing in a minimal fresh NativeScript 8.9.x Angular app.

Reproduction

Reproduction steps

  1. In terminal run npc ns build iOS
  2. Open project in Xcode 26.3
  3. Build/run on physical iPhone
  4. Observe startup crash

Relevant log output (if applicable)

Runtime initialization took 41ms (version 8.9.2-next.2025-02-28-13593660746, V8 version 10.3.22)

NativeScript encountered a fatal error:

Error calling module function
Error calling module function
ReferenceError: UIContentSizeCategoryExtraSmall is not defined
File: (file:///app/runtime.js:31:12)

StackTrace:
    ./node_modules/@nativescript/core/accessibility/font-scale.ios.js(file:///app/vendor.js:8047:6)
    at __webpack_require__(file:///app/runtime.js:28:33)
    at fn(file:///app/runtime.js:222:21)
    at ./node_modules/@nativescript/core/accessibility/accessibility-css-helper.js(file:///app/vendor.js:7366:69)
    at __webpack_require__(file:///app/runtime.js:28:33)
    at fn(file:///app/runtime.js:222:21)
    at ./node_modules/@nativescript/core/application/application-common.js(file:///app/vendor.js:8627:97)
    at __webpack_require__(file:///app/runtime.js:28:33)
    at fn(file:///app/runtime.js:222:21)
    at ./node_modules/@nativescript/core/application/application.ios.js(file:///app/vendor.js:9516:77)
    at __webpack_require__(file:///app/runtime.js:28:33)
    at fn(file:///app/runtime.js:222:21)
    at ./node_modules/@nativescript/core/application/index.ios.js(file:///app/vendor.js:10013:70)
    at __webpack_require__(file:///app/runtime.js:28:33)
    at fn(file:///app/runtime.js:222:21)
    at ./node_modules/@nativescript/core/globals/index.js(file:///app/vendor.js:17262:5)
    at __webpack_require__(file:///app/runtime.js:28:33)
    at fn(file:///app/runtime.js:222:21)
    at ./node_modules/@nativescript/core/inspector_modules.js(file:///app/vendor.js:18674:66)
    at __webpack_require__(file:///app/runtime.js:28:33)
    at __webpack_exec__(file:///app/tns_modules/inspector_modules.js:21:39)
    at (file:///app/tns_modules/inspector_modules.js:22:71)
    at __webpack_require__.X(file:///app/runtime.js:154:21)
    at (file:///app/tns_modules/inspector_modules.js:22:47)
    at (file:///app/tns_modules/inspector_modules.js:27:3)
    at require(:1:232)


------

after patching:

Runtime initialization took 33ms (version 8.9.2-next.2025-02-28-13593660746, V8 version 10.3.22)

NativeScript encountered a fatal error:

Error calling module function
ReferenceError: Cannot access 'Application' before initialization
File: (file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/vendor.js:9510:59)

StackTrace:
    Application(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/vendor.js:9510:60)
    at ./node_modules/@nativescript/core/media-query-list/index.js(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/vendor.js:19556:70)
    at __webpack_require__(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/runtime.js:23:42)
    at ./node_modules/@nativescript/core/ui/styling/css-selector.js(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/vendor.js:46497:75)
    at __webpack_require__(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/runtime.js:23:42)
    at ./node_modules/@nativescript/core/ui/styling/style-scope.js(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/vendor.js:49479:71)
    at __webpack_require__(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/runtime.js:23:42)
    at ./node_modules/@nativescript/core/ui/core/view-base/index.js(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/vendor.js:27286:78)
    at __webpack_require__(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/runtime.js:23:42)
    at ./node_modules/@nativescript/core/ui/core/view/view-common.js(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/vendor.js:29479:68)
    at __webpack_require__(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/runtime.js:23:42)
    at ./node_modules/@nativescript/core/ui/core/view/index.ios.js(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/vendor.js:28483:70)
    at __webpack_require__(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/runtime.js:23:42)
    at ./node_modules/@nativescript/core/ui/frame/frame-common.js(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/vendor.js:32487:68)
    at __webpack_require__(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/runtime.js:23:42)
    at ./node_modules/@nativescript/core/ui/frame/index.ios.js(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/vendor.js:33304:71)
    at __webpack_require__(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/runtime.js:23:42)
    at ./node_modules/@nativescript/core/ui/dialogs/dialogs-common.js(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/vendor.js:31569:64)
    at __webpack_require__(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/runtime.js:23:42)
    at ./node_modules/@nativescript/core/ui/dialogs/index.ios.js(file:///var/containers/Bundle/Application/79286DC3-7347-4853-B69B-75047A13C9E8/triplyapp.app/app/vendor.js:31765:73)

Environment

OS: macOS 26.3.1
CPU: (14) x64 Apple M4 Pro
Shell: /bin/zsh
node: 20.20.1
npm: 10.8.2
nativescript: 8.7.2

# android
java: 17.0.6
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found

# ios
xcode: 26.3/17C529
cocoapods: 1.15.2
python: Not Found
python3: 3.10.10
ruby: 2.6.10
platforms: 
  - DriverKit 25.2
  - iOS 26.2
  - macOS 26.2
  - tvOS 26.2
  - visionOS 26.2
  - watchOS 26.2

Dependencies

"dependencies": {
  "@angular/animations": "~15.0.0",
  "@angular/common": "~15.0.0",
  "@angular/compiler": "~15.0.0",
  "@angular/core": "~15.0.0",
  "@angular/forms": "~15.0.0",
  "@angular/platform-browser": "~15.0.0",
  "@angular/platform-browser-dynamic": "~15.0.0",
  "@angular/router": "~15.0.0",
  "@nativescript-community/ble": "^3.1.15",
  "@nativescript-community/perms": "^3.0.0",
  "@nativescript-community/ui-lottie": "^6.0.0",
  "@nativescript-community/ui-material-bottom-navigation": "^7.0.43",
  "@nativescript-community/ui-material-ripple": "^7.1.3",
  "@nativescript-community/ui-material-tabs": "^7.1.3",
  "@nativescript-community/ui-pulltorefresh": "^2.5.3",
  "@nativescript/angular": "15.0.2",
  "@nativescript/core": "8.9.3-next-05-28-2025-15305824880",
  "@nativescript/datetimepicker": "^2.1.13",
  "@nativescript/directions": "^2.0.2",
  "@nativescript/geolocation": "^8.1.0",
  "@nativescript/theme": "~3.0.2",
  "@ngx-translate/core": "^14.0.0",
  "@ngx-translate/http-loader": "^7.0.0",
  "@sergeymell/nativescript-svg": "^1.1.2",
  "crypto-js": "^4.2.0",
  "date-fns": "^4.1.0",
  "nativescript-ui-gauge": "^15.2.3",
  "rxjs": "~7.6.0",
  "zone.js": "~0.12.0"
},
"devDependencies": {
  "@angular-devkit/build-angular": "~15.0.0",
  "@angular/compiler-cli": "~15.0.0",
  "@nativescript/android": "8.9.2-next.2025-08-24-17192049177",
  "@nativescript/ios": "8.9.2-next.2025-02-28-13593660746",
  "@nativescript/types": "8.9.1",
  "@nativescript/webpack": "5.0.23",
  "@ngtools/webpack": "~15.0.0",
  "@types/jest": "^29.5.12",
  "jest": "^29.7.0",
  "jest-junit": "^16.0.0",
  "patch-package": "^8.0.0",
  "ts-jest": "^29.1.2",
  "nativescript": "8.9.4-next-09-04-2025-17475697620",
  "typescript": "~4.8.4"
}

Please accept these terms

Activity

  1. farfromrefug commented on Mar 11, 2026

    @farfromrefug
    Collaborator

    @jpmartinsson did you try to clean and build again?
    it works fine here

  2. CatchABus commented on Mar 11, 2026

    @CatchABus
    Contributor

    @jpmartinsson I recall this problem got fixed in the latest v8.9.x iOS runtime, so I'd advice you to update it since you use @nativescript/ios 8.9.2-next.2025-02-28-13593660746.

  3. NathanWalker commented on Mar 11, 2026

    @NathanWalker
    Contributor

    I'd also recommend using @nativescript/ios 9.x.x - for latest Xcode, Android Studio and other platform related items, always best to use latest cli (npm i -g nativescript) with latest runtimes (@nativescript/ios, @nativescript/android 9.x.x)

  4. jpmartinsson commented on Mar 12, 2026

    @jpmartinsson
    Author

    Thanks for the input. We weren't planning on moving to Nativescript 9.x.x now, but will consider that. Main reason for waiting is that we thought we had to raise the angular version from 15 to something higher if we move to NS9 (or is this perhaps a faulty thought). If NS9 is the way to go and doesn't require an Angular upgrade we're in.

    In the meantime...

    I minimized the project as far as I reasonably can on the Angular 15 / NativeScript 8 line, and the app still crashes on startup with Xcode 26.3.

    Environment:

    • Node: 20.20.1
    • Xcode: 26.3
    • @nativescript/core: 8.9.8
    • @nativescript/ios: 8.9.2
    • @nativescript/android: 8.9.1
    • @nativescript/types: 8.9.1
    • @nativescript/angular: 15.x

    What I minimized:

    • Removed almost all nonessential dependencies/plugins from package.json
    • Root app reduced to a blank boot screen
    • app.module reduced to only NativeScriptModule + AppComponent
    • main.ts reduced to standard bootstrap only
    • polyfills.ts reduced to the standard NativeScript/Angular/Zone imports only
    • app.css emptied
    • core.css emptied
    • Pod install now reports 0 dependencies / 0 pods

    Current minimal files:

    src/main.ts

    import './polyfills';
    import { platformNativeScript, runNativeScriptAngularApp } from '@nativescript/angular';
    import { AppModule } from '~/app/app.module';
    
    runNativeScriptAngularApp({
      appModuleBootstrap: () => platformNativeScript().bootstrapModule(AppModule),
    });
    

    polyfills.ts

    import '@nativescript/core/globals';
    import '@nativescript/angular/polyfills';
    import '@nativescript/zone-js/dist/pre-zone-polyfills';
    import 'zone.js';
    import '@nativescript/zone-js';
    

    app.module.ts

    import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
    import { NativeScriptModule } from '@nativescript/angular';
    import { AppComponent } from './app.component';
    
    @NgModule({
      bootstrap: [AppComponent],
      imports: [NativeScriptModule],
      declarations: [AppComponent],
      schemas: [NO_ERRORS_SCHEMA],
    })
    export class AppModule {}
    

    app.component.ts

    import { Component } from '@angular/core';
    
    @Component({
      selector: 'ns-app',
      template: `
        <Page>
          <ActionBar title="Boot Test"></ActionBar>
          <StackLayout>
            <Label text="App booted"></Label>
          </StackLayout>
        </Page>
      `,
    })
    export class AppComponent {}
    

    Build output:

    • Platform ios successfully added. v8.9.2
    • webpack succeeds
    • Xcode build succeeds
    • Pod installation reports 0 dependencies / 0 total pods installed

    Runtime crash on device:

    ReferenceError: Cannot access 'Application' before initialization
    File: (file:///.../triplyapp.app/app/vendor.js:2150:59)
    
    StackTrace:
        Application(file:///.../vendor.js:2150:60)
        at ./node_modules/@nativescript/core/media-query-list/index.js(file:///.../vendor.js:11669:70)
        at ./node_modules/@nativescript/core/ui/styling/css-selector.js
        at ./node_modules/@nativescript/core/ui/styling/style-scope.js
        at ./node_modules/@nativescript/core/ui/core/view-base/index.js
        at ./node_modules/@nativescript/core/ui/core/view/view-common.js
        at ./node_modules/@nativescript/core/ui/core/view/index.ios.js
        at ./node_modules/@nativescript/core/ui/frame/frame-common.js
        at ./node_modules/@nativescript/core/ui/frame/index.ios.js
        at ./node_modules/@nativescript/core/ui/dialogs/dialogs-common.js
        at ./node_modules/@nativescript/core/ui/dialogs/index.ios.js
        ...
    
    

    Earlier in the process, on the same Xcode 26.3 path, I also hit:
    ReferenceError: UIContentSizeCategoryExtraSmall is not defined
    from font-scale.ios.js

    Given the current minimized state, this no longer appears to be caused by app code, CSS, plugins, or CocoaPods integration.

    Could you please confirm:

    1. whether NativeScript 8.9.x is expected to work reliably with Xcode 26.3 on Angular 15
    2. the exact working version combination you tested (@nativescript/core, @nativescript/ios, CLI, Node)
    3. whether Cannot access 'Application' before initialization in index.js is a known NativeScript 8 issue on Xcode 26
      ...or should we abandon this and go NS9 + Angular 15 (if possible) right away?
  5. farfromrefug commented on Mar 12, 2026

    @farfromrefug
    Collaborator

    @jpmartinsson Dont go 9. You ll have more problems on top of the ones you already have.
    Yes 8.9.x is stable and should work fine with Xcode26.3 and Angular 15 (though i am not an angular dev).
    the application error you are seeing is totally normal if there was the error first of UIContentSizeCategoryExtraSmall not being defined.
    I think it is a metadata error . First @nativescript/ios: 8.9.2 is not the latest i would use 8.9.5. And i think it is the fix as 8.9.3 mention xcode 26 support

  6. jpmartinsson commented on Mar 13, 2026

    @jpmartinsson
    Author

    Fantastic! I changed to @nativescript/iOS: 8.9.5 and the startup errors were gone. Thanks for your quick and insightful resolution to my problems.

  7. NathanWalker commented on Mar 13, 2026

    @NathanWalker
    Contributor

    I noticed in your output one key thing that may have been causing your issue. NS 9 requires node 22+, above looks like you had Node: 20.20.1. Using latest node LTS may be all you needed alongside latest cli, npm i -g nativescript. It's possible though that angular 15 has node engine restrictions so updating to latest angular may help there too.

    If want to explore NS 9 further can reach out in discord.

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

    bug-pending-triageReported bug, pending triage to confirm.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions