sean-adams / dataslayer

A Chrome extension to enhance tag management and analytics debugging.
MIT License
73 stars 18 forks source link

Extension Causing Console Errors for Adobe Launch #131

Closed jaredrileysmith closed 3 years ago

jaredrileysmith commented 3 years ago

Please include, if available:

Please be advised that this issue results in failure of Adobe Launch actions (e.g. tracking calls not sent, etc.)

Images below for illustration of observations

image

image

sschaefa commented 3 years ago

We also experienced this issue, and I did some debugging. It happens if you have Data Elements that result in the value null. Having undefined, a function, a string, a number etc. works fine, but null leads to this error.

Line 82+83 of the Extension do that:

          typeof cleanValue === 'object' &&
          typeof cleanValue.then === 'function'

This check is not enough, because typeof cleanValue === 'object' will still work for null, but typeof cleanValue.then === 'function' is the JavaScript error. The extension needs to be modified to:

          typeof cleanValue === 'object' &&
          cleanValue != null &&
          typeof cleanValue.then === 'function'

This would fix the error. You can fix the error on Launch side if you avoid null in your Data Elements for now.

sean-adams commented 3 years ago

Hi all

@jaredrileysmith thanks for flagging this issue, and @sschaefa thank you for digging in and identifying the solution. Frustratingly, this is an issue that was initially fixed a few months ago, but I apparently missed another location where it could occur. This will be fixed in dataslayer 1.5.1 which I am sending to the web store momentarily.

Best Sean