Hashed and nonhashed clientlibs load together in Adobe Experience Manager

In Adobe Experience Manager (AEM), exporting Experience Fragments to Adobe Target results in both hashed and non-hashed versions of the same client library loading on the page. This behavior leads to duplicate JavaScript execution without visible errors. To fix this issue, implement the recommended client library overlay so only the hashed client library loads.

Description description

Environment

  • Product: Adobe Experience Manager, Adobe Experience Manager as a Cloud Service(all versions)
  • Version: 6.5
  • Instance: Experience Fragments exported to Adobe Target

Issue/Symptoms

  • Exporting Experience Fragments to Adobe Target and delivering them on a Target-driven page loads two versions of the same client library.
  • A Target-delivered page loads two versions of the same client library.
  • One file includes a hash in the filename, such as clientlibs/cws/clientlibs/clientlib-jpm/clientlib-site.min.<project-name>.js.
  • One file uses a non-hashed filename, such as clientlibs/cws/clientlibs/clientlib-jpm/clientlib-site.min.js.
  • Both files contain identical JavaScript code.
  • The page executes duplicate JavaScript without showing error messages.

Cause

By default, both the AEM page and the exported Experience Fragment can include the same client library, which results in duplicate loading. The overlay ensures that only the page’s own hashed client library is included, which is the intended and supported behavior.

Resolution resolution

To fix this issue, follow these steps:

  1. Review the Experience Fragments integration documentation and confirm that the client library overlay is implemented as described.
  2. Confirm that after applying the overlay, only the hashed client library (for example, clientlib-site.min.<project-name>.js) loads on the Target-delivered page.
  3. Validate that the non-hashed version (clientlib-site.min.js) is no longer present in the page source.
  4. Test the page to confirm that there is no duplicate JavaScript execution and that all expected functionality is present.
recommendation-more-help
experience-cloud-kcs-help-kbarticles