Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Exception in Web SDK Extension #346

Open
jbradley-evo opened this issue Aug 23, 2023 · 1 comment
Open

Uncaught Exception in Web SDK Extension #346

jbradley-evo opened this issue Aug 23, 2023 · 1 comment

Comments

@jbradley-evo
Copy link

The following error popped up in the console:

Uncaught (in promise) TypeError: [alloy] [Identity] An error occurred while executing the getIdentity command.
Caused by: [Identity] An error occurred while executing the onBeforeRequest lifecycle hook.
Caused by: o.split is not a function

This kept the page from working. Investigation showed the root of the problem was the adobe_mc parameter had been appended to the URL twice (by accident). The code that parses the parameter value does not do a type check after getting the parameter, and when there are more than one instance of a parameter it is represented by an array instead of a string. The code attempts to do a split() operation, but since the type is Array the exception is thrown.

The extension needs to be updated to check the type and take appropriate action if it is an Array and not a String.

We are correcting the problem that caused the parameter to be added twice, but the extension should have better error handling.

To reproduce, create a link with the adobe_mc parameter duplicated and observe the behavior on the destination site.

Here is a screenshot of the code that threw the exception:
Extension Code Extract

This is the value of "o". Note that it is an Array and not a String as the code is expecting
adobe_mc Param as Array

@jonsnyder
Copy link
Contributor

Thanks for the report. Yes this error is not ideal. Logged as https://jira.corp.adobe.com/browse/PDCL-11037

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants