Skip to content

Khan Academy returns 0 regions: main JS bundle (2.38MB) exceeds max_script_bytes limit #9

@dbhurley

Description

@dbhurley

Problem

plasmate fetch https://www.khanacademy.org returns 0 regions and 0 elements.

Root Cause (Two Issues Found)

Issue 1: Script size limit (FIXED)

The default max_script_bytes was 50KB per external script. Khan Academy's main React bundle is 2.38MB. Raised the default to 3MB per script and 10MB total in this investigation.

Issue 2: V8 ICU data missing (BLOCKING)

After raising the script limit, the 2.38MB bundle now loads and executes, but React crashes with:

RangeError: Internal error. Icu error.

Khan Academy's JavaScript uses Intl APIs (Intl.NumberFormat, Intl.DateTimeFormat, etc.) for locale-aware formatting. These APIs require ICU (International Components for Unicode) data to be bundled with V8. Our V8 build does not include ICU data, so any JavaScript that uses Intl APIs will throw a RangeError.

This affects any site that uses:

  • Intl.NumberFormat
  • Intl.DateTimeFormat
  • Intl.Collator
  • new Date().toLocaleDateString()
  • Number/currency formatting
  • React's locale-aware rendering

Sites likely affected

  • khanacademy.org (confirmed)
  • stripe.com (pricing uses Intl.NumberFormat)
  • booking.com (dates, currencies)
  • Most React apps with i18n

Fix Options

  1. Include ICU data in the V8 build - Adds ~10MB to binary size but enables full Intl support
  2. Provide a minimal ICU stub - Mock Intl APIs with basic en-US formatting (smaller, less correct)
  3. Build V8 with v8_enable_i18n_support=true - The proper fix, requires rebuilding rusty_v8

Verification

RUST_LOG=debug plasmate fetch https://www.khanacademy.org 2>&1 | grep 'Icu error'
# RangeError: Internal error. Icu error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coverageWebsite coverage improvementsv8V8 JavaScript engine issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions