You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CMP Validator 2.3 panel crashes: TypeError reading '1' when validating a spec-correct unregistered CMP stub #219
CMP Validator 2.3 crashes with TypeError: Cannot read properties of undefined (reading '1') when validating a page whose CMP is a spec-correct unregistered stub
Environment: CMP Validator 2.3 (Chrome extension, CRX ffhhjklgcfabkpholngojpkijlafjooc), page serves a spec-correct IAB TCF stub (no registered CMP yet — site under development).
Our stub provides (verified in-page and with the official @iabtcf/core decoder):
__tcfapi function + static __tcfapiLocator iframe
ping: {cmpId: 0, gvlVersion: 3, tcfPolicyVersion: 5, cmpStatus: 'loaded', ...} (ping gvlVersion matches a real GVL archive)
TC string: decodes cleanly with @iabtcf/coreTCString.decode (vendorListVersion 179 = current, policyVersion 5, 56–59 chars, vendor range encoding for GVL 755 tested)
Crash (uncaught, in the validator panel render):
TypeError: Cannot read properties of undefined (reading '1')
at index.c163c4e5.js:136:32645
at Array.map (<anonymous>)
at h (index.c163c4e5.js:136:32139)
at pk (index.c163c4e5.js:136:33128)
Analysis from the 2.3 bundle: the crashing h is the section renderer — E = R ? Object.values(R) : null; E.map(R => …) where R = d === "specialFeatures" ? r.vendorList[d] : r.vendorList[d + "s"] (r.vendorList = the fetched GVL). For section ids like purposeConsents/vendorConsents, d + "s" produces keys (purposeConsentss, vendorConsentss) that do not exist in the GVL JSON — R is undefined and E becomes null, which is guarded. The reading '1' crash occurs inside the map callback for a section where R IS truthy — likely iterating GVL.purposes/GVL.vendors entries and reading numeric-keyed fields ([1]) that are absent for the validator's internal test data path (cmpId 1234 / gvlVersion 224 appear in the panel in this state).
Additional observation: the panel state (cmpId 1234, gvlVersion 224) does not match the page's actual CMP data (cmpId 0, gvlVersion 179) — suggesting the validator substitutes its own reference data for unregistered CMPs, and its compliance-check render then crashes on that substitute's incomplete v2.2 shape.
Expected: the panel renders all sections (checks can legitimately fail/pass) instead of throwing.
Happy to provide: full tcData JSON, the TC string, page URL for reproduction (www-test.gazette.cofinity.io — test env, reachable publicly).
Activity