Note: this is an issue in the gcoe-adobe-client-data-layer Launch extension, not in Adobe's core adobe-client-data-layer open-source library. The core library's documented pattern already handles this correctly; this extension's bundled data element module does not.
Expected behavior: The "Data Layer Computed State" data element should safely return undefined (or defer) when the Adobe Client Data Layer library hasn't finished upgrading window.adobeDataLayer from its initial stub array into the full instance, instead of throwing an error.
Actual behavior: A data element using this module throws TypeError: t.getState is not a function when it evaluates before the ACDL library has finished initializing.
In my scenario: I was using a clean container very light in rules and file size.
Note: this is an issue in the gcoe-adobe-client-data-layer Launch extension, not in Adobe's core adobe-client-data-layer open-source library. The core library's documented pattern already handles this correctly; this extension's bundled data element module does not.
Expected behavior: The "Data Layer Computed State" data element should safely return undefined (or defer) when the Adobe Client Data Layer library hasn't finished upgrading window.adobeDataLayer from its initial stub array into the full instance, instead of throwing an error.
Actual behavior: A data element using this module throws TypeError: t.getState is not a function when it evaluates before the ACDL library has finished initializing.
In my scenario: I was using a clean container very light in rules and file size.