Skip to content

adobeDataLayer.push fails when some older versions of RequireJS already exist on page #102

@charltoncraig

Description

@charltoncraig

Expected Behaviour

adobeDataLayer.push({'abc':1}) should append {'abc':1} to the adobeDataLayer queue

Actual Behaviour

Uncaught TypeError: isPlainObject is not a function
at getType (adobe-client-data-layer.js:547)
    at module.exports (adobe-client-data-layer.js:540)
    at adobe-client-data-layer.js:225
    ...

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Navigate to about:blank
Paste into the console and execute:

var scriptElement = document.createElement('script');
scriptElement.src = "https://requirejs.org/docs/release/2.1.9/minified/require.js"
document.body.append(scriptElement);

Paste into the console and execute (above code block must execute first):

window.adobeDataLayer =  [];
var scriptElement = document.createElement('script');
scriptElement.src = "https://unpkg.com/@adobe/adobe-client-data-layer@1.1.0/dist/adobe-client-data-layer.js";
document.body.append(scriptElement);

Paste into the console and execute:
adobeDataLayer.push({'abc':1})

Platform and Version

Chrome Version 85.0.4183.102

Sample Code that illustrates the problem

Logs taken while reproducing problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected problem or unintended behavior that impairs normal functioning.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions