Open Bug 1902494 Opened 5 months ago Updated 2 months ago

console.bloomberg.com - Site doesn't load

Categories

(Web Compatibility :: Site Reports, defect, P1)

Tracking

(Not tracked)

People

(Reporter: ksenia, Unassigned)

References

()

Details

(Keywords: webcompat:contact-in-progress, webcompat:site-report, Whiteboard: [webcompat-source:web-bugs])

User Story

platform:windows,mac,linux
impact:site-broken
configuration:general
affects:all
branch:release
diagnosis-team:javascript
outreach-assignee:emilio
outreach-contact-date:2024-09-04

Environment:
Operating system: Linux
Originally reported Firefox version: Firefox 122.0
Last reproduced with the following UA: Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0
Platforms reproduced on: linux

Steps to reproduce:
I tested in Chrome and it was loaded correctly

Actual Behavior:
Page not loading correctly

Created from https://github.com/webcompat/web-bugs/issues/130817

Severity: S4 → S2
User Story: (updated)
Priority: P2 → P1

The site doesn't load most of the time, so setting impact:site-broken

User Story: (updated)
No longer depends on: firefox-not-supported
Summary: console.bloomberg.com - Firefox is not a recommended browser → console.bloomberg.com - Site doesn't load

I get

Uncaught Error: Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.
Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)
    assertZonePatched https://console.bloomberg.com/polyfills.1791f3281314e316a65c.js:1
    e https://console.bloomberg.com/main.dd3cf4cf6239df71288c.js:1
    bootstrapModuleFactory https://console.bloomberg.com/main.dd3cf4cf6239df71288c.js:1
    3fqI https://console.bloomberg.com/main.dd3cf4cf6239df71288c.js:1
    n https://console.bloomberg.com/runtime.c2cb1ae11831315a0a4a.js:1
    0 https://console.bloomberg.com/main.dd3cf4cf6239df71288c.js:1
    n https://console.bloomberg.com/runtime.c2cb1ae11831315a0a4a.js:1
    t https://console.bloomberg.com/runtime.c2cb1ae11831315a0a4a.js:1
    a https://console.bloomberg.com/runtime.c2cb1ae11831315a0a4a.js:1
    <anonymous> https://console.bloomberg.com/main.dd3cf4cf6239df71288c.js:1

on the broken loads.

forced is true in Firefox and false in Chrome

There's UA sniffing happening that looks like:

  function (e, t, n) {
    var r,
    a,
    i = n(4),
    o = n(71),
    c = i.process,
    s = c &&
    c.versions,
    u = s &&
    s.v8;
    u ? a = (r = u.split('.')) [0] + r[1] : o &&
    (!(r = o.match(/Edge\/(\d+)/)) || r[1] >= 74) &&
    (r = o.match(/Chrome\/(\d+)/)) &&
    (a = r[1]),
    e.exports = a &&
    + a
  }

Spoofing the Chrome UA causes the site to load properly

It looks like core-js is detecting broken subclassing in Zone.js's Promise polyfill. With Chrome versions newer than 51 it skips that detection.

console.bloomberg.com doesn't seem to have loading problems in Safari which is not what I'd expect given the above

It seems like Safari doesn't trigger this because it runs main.dd3cf4cf6239df71288c.js/bootstrapModuleFactory before index.js.

Here's a profile that shows us running the async main.js script before the sync index.js https://share.firefox.dev/4g1LnaI

Smaug, do you know why we run the async script first?

Flags: needinfo?(smaug)
User Story: (updated)

Another thing of note is that Zone.js Promise polyfill purposely pretends to be native: https://github.com/angular/zone.js/pull/564/commits/a556add49357d749eecf23220addda748dfb68ca

This causes core-js to skip over the subclassing test.

async scripts run whenever they get chance to run.

HTML spec
"For classic scripts, if the async attribute is present, then the classic script will be fetched in parallel to parsing and evaluated as soon as it is available (potentially before parsing completes)."

So nothing defines if an async script before a sync script runs before or after it.

jrmuizel, did you mean sync main.js, and async index.js, since that is what I see in the source code. URLs are stripped from the profile.

Flags: needinfo?(smaug) → needinfo?(jmuizelaar)

Yes, sorry I did mean sync main.js and async index.js.

Flags: needinfo?(jmuizelaar)

Have we contacted Bloomberg that their use of <script async> seems to be racy?

Also, it seems like current versions of zone.js have working subclassing working and thus won't be overwritten by core-js

User Story: (updated)
Depends on: 1917389
You need to log in before you can comment on or make changes to this bug.