Repository navigation
Open
Labels
BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.DailyKSv2KSv2ExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributorOverdue
Description
Sentry
| Sentry ID | Users (total since first seen) | Events | Users (last 14d, production 9.5.25 to 9.5.27) | First seen | Error |
|---|---|---|---|---|---|
| APP-HWF | 50 | 796 | 6 (9.5.25: 1, 9.5.26: 4, 9.5.27: 1) | 2026-07-16 | ReferenceError: WebAssembly is not defined |
| APP-M76 | 84 | 177 | 4 (9.5.25: 4) | 2026-09-21 | RuntimeError: Aborted(both async and sync fetching of the wasm failed) |
| APP-N6Q | 11 | 13 | 3 (9.5.26: 2, 9.5.27: 1) | 2026-10-17 | same error as APP-M76, different route |
Impact (snapshot at filing)
- Last seen: 2026-11-02 (ongoing, still on 9.5.27)
- Platform: web (standalone), Chrome and Edge on Windows in the sample events
- App version(s): 9.5.25 to 9.5.27 in the scan window
- Affected route(s) (parameterized):
/home,/search/view/:reportID - Mechanism: auto.browser.global_handlers.onunhandledrejection, level error, not app blocking
Stack trace (top frames, first-party only)
APP-HWF: ReferenceError: WebAssembly is not defined
react lazyInitializer -> @shopify/react-native-skia/lib/module/web/WithSkiaWeb.js:15 await LoadSkiaWeb(opts)
@shopify/react-native-skia/lib/module/web/LoadSkiaWeb.js:18 CanvasKitInit(opts)
canvaskit-wasm/bin/full/canvaskit.js:167 WebAssembly.instantiateStreaming
APP-M76 / APP-N6Q: RuntimeError: Aborted(both async and sync fetching of the wasm failed)
@shopify/react-native-skia/lib/module/web/WithSkiaWeb.js:15 await LoadSkiaWeb(opts)
@shopify/react-native-skia/lib/module/web/LoadSkiaWeb.js:21 CanvasKit = await ckSharedPromise
canvaskit-wasm/bin/full/canvaskit.js:166 WebAssembly.instantiate -> abort
The only first-party caller of WithSkiaWeb is src/components/Charts/SkiaWebChart/index.tsx.
Suspected cause
SkiaWebChart wraps WithSkiaWeb in an ErrorBoundary, so the chart falls back to ChartFailedToLoad and the app keeps working. The CanvasKit init promise still rejects with no handler, so Sentry records an unhandled rejection. There are two gaps:
isSkiaWebSupported(src/components/Charts/SkiaWebChart/isSkiaWebSupported.ts) probes WebGL only. It does not checktypeof WebAssembly, so browsers with WebAssembly turned off still mount Skia. Edge with enhanced security mode is a likely source of APP-HWF.- When the
canvaskit.wasmfetch fails (offline, or blocked by a proxy), the shared CanvasKit promise rejects and nothing catches it.
User impact is low: the chart shows its failed state. The fix should add a WebAssembly check to isSkiaWebSupported and catch the CanvasKit load rejection, so the fallback stays quiet.
Reproduction
- Open New Expensify in a browser with WebAssembly turned off, for example Edge with enhanced security mode set to strict.
- Open a page that renders a chart, such as
/home. - The chart shows its failed state, and Sentry records
ReferenceError: WebAssembly is not defined.
These steps come from the stack trace and are not confirmed yet.
Related
- Sibling Sentry IDs: APP-HWF, APP-M76, APP-N6Q (all listed above)
- Prior GH issues: Web CanvasKit wasm fails to instantiate (closed). Fix skia crash with mismatched canvaskit versions fixed the version mismatch
LinkError. The events in this issue have different causes.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022117475224633017276
- Upwork Job ID: 2117475224633017276
- Last Price Increase: 2026-11-03
Issue Owner
Current Issue Owner: @truph01Reacted by melvin-bot
Metadata
Metadata
Labels
BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.DailyKSv2KSv2ExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributorOverdue
Type
Projects
- StatusShow more project fieldsNo status
Activity
melvin-bot commentedon Nov 3, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)[-][Sentry: APP-HWF / APP-N6Q / APP-M76] Web: CanvasKit load failures escape SkiaWebChart as unhandled rejections[/-][+][$175] [Sentry: APP-HWF / APP-N6Q / APP-M76] Web: CanvasKit load failures escape SkiaWebChart as unhandled rejections[/+]melvin-bot commentedon Nov 3, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022117475224633017276
MelvinBot commentedon Nov 3, 2026
Proposal
What is the root cause of that problem?
The unhandled rejection comes from inside
canvaskit-wasm(0.41.0), not from App code. OurErrorBoundaryworks, but it can't reach the promise that leaks.CanvasKitInitcreates its own internal "ready" promise (kainbin/full/canvaskit.js, line 8). When wasm setup fails, the glue rejects two promises:CanvasKitInitreturns.LoadSkiaWebawaits it, and theErrorBoundarycatches it. ThenlogSkiaLoadErrorreports it as a warning.kapromise. The glue returns it only on success, so after a failure nothing ever attaches a handler. The browser firesunhandledrejection, and Sentry records APP-HWF, APP-M76, or APP-N6Q.The two Sentry errors fail in different ways:
isSkiaWebSupportedchecks only WebGL, so Skia still mounts. The glue then readsWebAssembly.instantiateStreamingand throws aReferenceError.canvaskit.wasmfetch fails. The glue'sabort()rejectskaand throws.LoadSkiaWebresetsckSharedPromiseafter a failure. Each later chart mount starts a freshCanvasKitInitand leaks anotherka, so one user can send several events.What changes do you think we should make in order to solve the problem?
Skip Skia when WebAssembly is missing. In
isSkiaWebSupported, return unsupported whentypeof WebAssembly !== 'object'ortypeof WebAssembly.instantiate !== 'function'.CanvasKitInitnever runs, so APP-HWF stops. Have the probe return a reason soChartUnavailablecan show the right text. The current WebGL message blames the wrong feature, and the "refresh" message won't help. Add a new key, for examplecommon.webAssemblyNotSupported, in every locale.Drop only the leaked copy of a wasm fetch failure. Add a small noise-filter integration next to the others in
THIRD_PARTY_NOISE_INTEGRATIONS. It should drop an event only when both of these are true:onunhandledrejection.Aborted(both async and sync fetching of the wasm failed)orWebAssembly is not defined, or the top frame is incanvaskit.js.The boundary's warning (fingerprint
skia-web-chart-load-failure) still records every real failure. Don't useignoreErrors. It matches on the message, so it would also drop that warning.Add unit tests for the probe (no WebAssembly, so unsupported) and for the filter (an unhandled copy is dropped and the boundary warning is kept).
What alternative solutions did you explore? (Optional)
canvaskit-wasmso it attaches a no-op.catchtoka. This fixes the leak at its source, but it means editing a minified vendor file again on every upgrade..catchtockSharedPromise, or preload CanvasKit in a wrapper. Neither works. That promise is already handled, andkais never exposed.Investigation details
canvaskit-wasm@0.41.0/bin/full/canvaskit.js, line 8 haska=new Promise((a,b)=>{fa=a;ia=b}). ThecreateWasmcatch at line 252 iscatch(b){return ia(b),Promise.reject(b)}.moduleRtn=kaat line 257 runs only on success. The glue supports only thelocateFilehook, with noinstantiateWasmoronAbort, so App options can't intercept the failure.canvaskit.js:167istypeof WebAssembly.instantiateStreaming, which throws when the global doesn't exist. APP-M76 frame:166isabort(), which callsia(a); throw a.SkiaWebChartis the only caller ofWithSkiaWeb, so the probe change covers every chart.skia-web-chart-load-failurewarning in the same session. I also didn't confirm the exactmechanism.typestring the web SDK sends. Check both before you finalize the filter.Possibly related: [HOLD FormidableLabs/victory-native-xl#687] Upgrade react-native-skia to v3. The upgrade changes the
canvaskit-wasmversion, so recheck the filter afterward.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/105709)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
Hazem20wosis commentedon Nov 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Web, when CanvasKit fails to load or instantiate (e.g. in environments where WebAssembly is disabled such as Edge in Enhanced Security Mode, or when fetching
canvaskit.wasmfails due to network/proxy issues), unhandled promise rejections escapeSkiaWebChartand flood Sentry with fatal errors (APP-HWF: ReferenceError: WebAssembly is not defined,APP-M76/APP-N6Q: RuntimeError: Aborted(both async and sync fetching of the wasm failed)).What is the root cause of that problem?
There are two distinct root causes:
Missing WebAssembly Capability Probe in
isSkiaWebSupported.ts:isSkiaWebSupported()(src/components/Charts/SkiaWebChart/isSkiaWebSupported.ts) probes WebGL/WebGL2 context availability and shader precision format, but never checks whether WebAssembly is supported.In browsers where WebAssembly is disabled or blocked by security policies (e.g., Edge Enhanced Security Mode / Super Duper Secure Mode),
isSkiaWebSupported()evaluates totrue.SkiaWebChartproceeds to mount<WithSkiaWeb />, which callsLoadSkiaWeb()->CanvasKitInit()->WebAssembly.instantiateStreaming(), immediately throwingReferenceError: WebAssembly is not defined(APP-HWF).Unhandled Promise Rejection from
LoadSkiaWeb/CanvasKitInit:In
@shopify/react-native-skia/lib/module/web/LoadSkiaWeb.js,CanvasKitInit(opts)returns a shared promise (ckSharedPromise).When
canvaskit.wasmfails to download (e.g. offline, connection timeout, corporate proxy blocking wasm),canvaskit.jsaborts and rejects this promise (APP-M76,APP-N6Q).Because
<WithSkiaWeb />lazily initializes CanvasKit inside an async import / component lifecycle without attaching a.catch()rejection handler on the shared module loader promise, the rejection is unhandled at the browser level and gets caught bywindow.onunhandledrejection, generating noisy Sentry error reports even though React's<ErrorBoundary>inSkiaWebChartgracefully showsChartFailedToLoad.What changes do you think we should make in order to solve the problem?
Add WebAssembly check to
isSkiaWebSupported.ts:Guard
isSkiaWebSupported()to verify thatWebAssemblyis globally defined and callable:Suppress unhandled rejections during CanvasKit loading in
SkiaWebChart/index.tsx:In
src/components/Charts/SkiaWebChart/index.tsx, attach an unhandledrejection event listener (or catch handler around the CanvasKit initialization lifecycle) scoped to CanvasKit / Skia wasm failures so they are routed throughlogSkiaLoadErroras warnings without escaping as unhandled window rejections.What alternative solutions did you explore? (Optional)
ErrorBoundary:Rejected because unhandled promise rejections originating from asynchronous
CanvasKitInitscript evaluation bypass standard React componentErrorBoundarylifecycles and triggerwindow.onunhandledrejectiondirectly.What automated tests can you add to prevent this from re-occurring?
In
tests/unit/isSkiaWebSupportedTest.ts:isSkiaWebSupported()returnsfalsewhenglobal.WebAssemblyisundefined.isSkiaWebSupported()returnsfalsewhenWebAssembly.instantiateis not a function.WebAssemblyis present and WebGL context is available.Contributor Details
ayolyn commentedon Nov 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Web, CanvasKit/Skia load failures escape as unhandled promise rejections, flooding Sentry with noise:
APP-HWF: ReferenceError: WebAssembly is not definedwhen WebAssembly is disabled (e.g. Edge Enhanced Security Mode).APP-M76/APP-N6Q: RuntimeError: Aborted(both async and sync fetching of the wasm failed)whencanvaskit.wasmdownload fails (offline, connection timeout, proxy blocking wasm).Although
SkiaWebChartwraps chart loading in anErrorBoundaryand logs the warning vialogSkiaLoadError, the unhandled internal promise incanvaskit-wasmleaks towindow.onunhandledrejectionand generates spurious fatal Sentry issues.What is the root cause of that problem?
Incomplete Capability Probe in
isSkiaWebSupported.ts:isSkiaWebSupported.tsonly probes WebGL2/WebGL context availability and shader float precision. It does not check forWebAssemblysupport. In environments where WebAssembly is disabled (such as Microsoft Edge in Strict Enhanced Security Mode),isSkiaWebSupported()returnstrue.SkiaWebChartmounts<WithSkiaWeb />, which callsLoadSkiaWeb()->CanvasKitInit(), immediately throwingReferenceError: WebAssembly is not defined(APP-HWF).Leaked Internal CanvasKit Promise Rejection on Wasm Fetch Failure:
When
canvaskit.wasmfails to download,canvaskit.jsaborts and rejects its internal initialization promise. Because this internal promise has no catch handler attached at the script loader level, the rejection bubbles up to the browser's globalunhandledrejectionevent (APP-M76/APP-N6Q).Meanwhile, React's
<ErrorBoundary>inSkiaWebChartcatches the error and cleanly shows<ChartFailedToLoad />, whilelogSkiaLoadErrorlogs a warning to Sentry under theskia-web-chart-load-failurefingerprint. The global unhandled rejection is therefore an unhandled duplicate that falsely escalates to fatal severity.What changes do you think we should make in order to solve the problem?
1. Add WebAssembly check to
src/components/Charts/SkiaWebChart/isSkiaWebSupported.ts:At the start of
isSkiaWebSupported(), verifyWebAssemblyis globally defined and providesinstantiate:When WebAssembly is disabled,
isSkiaWebSupported()immediately returnsfalse.SkiaWebChartdisplays<ChartUnavailable />and never attempts to load CanvasKit, completely eliminatingAPP-HWF.2. Filter unhandled CanvasKit wasm rejections in
src/setup/telemetry/setupSentry.ts:In
src/setup/telemetry/setupSentry.ts(or in a dedicated noise filter integration in@libs/telemetry/integrations/), drop unhandled rejection events specifically originating from CanvasKit wasm aborts:logSkiaLoadErrorwith tag{context: 'skia-web-chart-load'}and fingerprint['skia-web-chart-load-failure'].APP-M76andAPP-N6Qwithout masking legitimate chart rendering errors.What alternative solutions did you explore? (Optional)
ignoreErrors: [/both async and sync fetching of the wasm failed/]toSentry.init:Rejected because
ignoreErrorsmatches on the message across all reporting mechanisms, which would also suppress the intentional, structuredlogSkiaLoadErrorwarning captured by the chart boundary. Filtering based onmechanism.handled === falsedrops only the leaked unhandled duplicate.canvaskit-wasmvendor file:Rejected: Modifying third-party vendor bundles adds fragile patch maintenance overhead across updates when the capability probe and telemetry filter solve the issue at the application boundaries cleanly.
What automated tests can you add to prevent this from re-occurring?
tests/unit/isSkiaWebSupportedTest.ts:isSkiaWebSupported()returnsfalsewhenglobal.WebAssemblyis undefined.isSkiaWebSupported()returnsfalsewhenWebAssembly.instantiateis not a function.isSkiaWebSupported()returnstruewhen WebAssembly and WebGL context are available.tests/unit/setupSentryTest.ts:both async and sync fetching of the wasm failedis filtered out.logSkiaLoadErroris preserved and sent to Sentry.Contributor details
Your Expensify account email: juliusayolyn@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0105126232377c4c5c
melvin-bot commentedon Nov 3, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
truph01 commentedon Nov 5, 2026
I will take over based on https://expensify.slack.com/archives/C02NK2DQWUX/p1793857827124809?thread_ts=1793857716.135019&cid=C02NK2DQWUX
7 remaining items
TassioSales commentedon Nov 8, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On web platforms where WebAssembly is disabled, blocked by CSP, or fails to initialize, CanvasKit fails to load, escaping
SkiaWebChartas unhandled promise rejections (ReferenceError: WebAssembly is not defined/APP-HWF).What is the root cause of that problem?
In
SkiaWebChart/index.tsx(and the CanvasKit loader utility):CanvasKit initialization asynchronously loads the WebAssembly binary. When the browser environment lacks WebAssembly support or the fetch fails due to network/firewall policies, the promise rejection is not caught within the chart component boundary, leaking to the global
window.onunhandledrejectionhandler and Sentry.What changes do you think we should make in order to solve the problem?
SkiaWebChart/index.tsx:.catch()error handling to the CanvasKit initialization promise.What alternative solutions did you explore? (Optional)
Falling back to server-rendered chart images, but SVG client rendering provides instant local feedback without network latency.
mountiny commentedon Nov 8, 2026
(Vit's agent) @truph01 thanks for taking over the review here. These CanvasKit rejections are still active in Sentry. In the last 7 days, APP-HWF hit about 16 users, APP-M76 about 8, and APP-N6Q about 6. Could you review the proposals and pick one, so we can assign a contributor? If none of them is good enough, please share what is missing so we can keep this moving. Thank you!
truph01 commentedon Nov 10, 2026
@MelvinBot Your proposal looks promising. Draft PR
Screen.Recording.2026-11-10.at.10.42.28.mov
MelvinBot commentedon Nov 10, 2026
🤖 Web test steps verification results: ❌ fail
Verification blocked: the existing web session rendered a blank page. No product behavior was verified.
/home charts and navigation with WebAssembly available
The supplied session remained blank, with no navigation targets.WebAssembly-disabled fallback
Not tested: permitted tooling could not disable WebAssembly before initialization.Blocked CanvasKit download fallback
Not tested: permitted tooling did not support network interception.Created draft PR: Avoid CanvasKit initialization without WebAssembly and filter duplicate load errors, assigned to
truph01.All 40 targeted tests, typecheck, lint, spelling, and Storybook smoke checks passed. Full-suite testing timed out; remaining verification limitations are documented in the draft.
view run
[-][$175] [Sentry: APP-HWF / APP-N6Q / APP-M76] Web: CanvasKit load failures escape SkiaWebChart as unhandled rejections[/-][+][Due for payment 2026-11-23] [$175] [Sentry: APP-HWF / APP-N6Q / APP-M76] Web: CanvasKit load failures escape SkiaWebChart as unhandled rejections[/+]melvin-bot commentedon Nov 16, 2026
@truph01
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.39-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-11-23. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]