Skip to content

fix: guard extension.requires against non-iterable values on iOS 26.5 JavaScriptCore - #102

Draft
rajkumargaramie with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-array-from-error-ios-26-5
Draft

fix: guard extension.requires against non-iterable values on iOS 26.5 JavaScriptCore#102
rajkumargaramie with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-array-from-error-ios-26-5

Conversation

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown

iOS 26.5's JavaScriptCore can produce a plain object {} for extension.requires at runtime. Calling Array.from({}) in ExtensionManager.setupExtensions throws an uncatchable TypeError: {} is not iterable, crashing editor initialization.

Changes — packages/editor/src/ExtensionManager.ts:

  • Replace Array.from(extension.requires) with an Array.isArray() guard, falling back to [] for non-array values — consistent with the identical guard already present at line 220 of the same file
// Before
const childExtensions = Array.from(extension.requires).filter((e) =>
  typeof e !== 'string'
);

// After
const requires = Array.isArray(extension.requires) ? extension.requires : [];
const childExtensions = requires.filter((e) => typeof e !== 'string');

Related Issue

Checklist

  • I have read CONTRIBUTING.md

  • I ran deno task postinstall

  • My commits follow Conventional Commits

  • I added tests or documentation if needed

  • I have performed a self-review of my code

  • All commits are meaningful (no trivial fix: typo)

  • I have added tests that prove my fix is effective or that my feature works

Type of change:

  • feat
  • fix
  • chore
  • docs
  • test
  • refactor
  • ci
  • build

Copilot AI changed the title [WIP] Fix TypeError on Array.from() when requires is a plain object fix: guard extension.requires against non-iterable values on iOS 26.5 JavaScriptCore Jun 17, 2026
Copilot AI requested a review from rajkumargaramie June 17, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants