Hi -
I'm integrating AEP Analytics into my SPA via NPM. I'm able to make successful "sendEvent" calls that return a 200. However, when I run my test runner, Karma, via "npm test" I am getting this error:
Error: [alloy] The library has already been configured and may only be configured once.
Normally, that would point to these issues:
Check code to ensure that I am not accidentally loading the same library more than once
Ensure that I call alloy("configure") only once
But I've seen this issue as well that throws the same error but it's for a data set id issue -- which is unrelated to the error message.
Can anyone shed some light, please? Thanks for any input.
NOTE: This does not happen when I access the alloy.js files from the CDN.
Solved! Go to Solution.
Views
Replies
Total Likes
The Adobe Experience Platform Launch library has been defined more than once on the same page, as shown by this error notification. Because the library can only be configured once per page load, trying to configure it multiple times will result in this error.
To fix this problem, make sure the Launch library is only specified once on the page. Here are a few things to look into:
Examine your implementation: Examine the code to confirm that the Launch library is only configured once. Examine the code for any repeated calls to the configure function or any other code that may be loading the Launch library multiple times.
Check for conflicts: ensure there are no other libraries or scripts on the page that might interfere with the Launch library. Look for any other scripts that may be loading the Launch library or that may be changing the global window.s object.
Examine the Launch Environment: Check to see whether the Launch environment is properly configured and if there are any duplicate or conflicting rules or extensions that might be causing the problem.
Examine the browser console: In the browser console, look for any error messages or warnings connected to the Launch library or its configuration. This might offer additional details on what is causing the problem.
Review the below link for the complete configuration:
Views
Replies
Total Likes
The Adobe Experience Platform Launch library has been defined more than once on the same page, as shown by this error notification. Because the library can only be configured once per page load, trying to configure it multiple times will result in this error.
To fix this problem, make sure the Launch library is only specified once on the page. Here are a few things to look into:
Examine your implementation: Examine the code to confirm that the Launch library is only configured once. Examine the code for any repeated calls to the configure function or any other code that may be loading the Launch library multiple times.
Check for conflicts: ensure there are no other libraries or scripts on the page that might interfere with the Launch library. Look for any other scripts that may be loading the Launch library or that may be changing the global window.s object.
Examine the Launch Environment: Check to see whether the Launch environment is properly configured and if there are any duplicate or conflicting rules or extensions that might be causing the problem.
Examine the browser console: In the browser console, look for any error messages or warnings connected to the Launch library or its configuration. This might offer additional details on what is causing the problem.
Review the below link for the complete configuration:
Views
Replies
Total Likes
The extra configuration call is the first thing I checked. The error is a red herring and it only happens when installing the library via NPM. I think the team should check into it. I'm using the CDN now and it's working fine. Here's the directions I followed:
I'm not sure why the solution above has been accepted as it did not solve my problem. The problem lies within the NPM package version of the library.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies