first time load issue - aem dynamic modules load issue | Community
Skip to main content
Level 2
August 13, 2024
Solved

first time load issue - aem dynamic modules load issue

  • August 13, 2024
  • 1 reply
  • 1029 views

hey everyone,
i need some help on below issue, can you suggest

We have dynamic-modules clientlib and it doesnt load on first hit in the browser, 2nd load onwards, it works fine and keeps working for few hours

do you have some pointer

tried, webpack chunking, code exclusion, dumplibs, nothing is of help

please some explain what is going wrong with clientlib-dynamic-modules

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MukeshYadav_

Hi @devendrabhn ,

Other clientlibs are getting added via script tag like below which load as page loads

How ever dynamic clientlibs are getting called from js on some condition, which is not  fulfilled at first load.

Either check your condition in debug mode or share the code how your are adding dynamic module cleintlibs  

check and debug these condition in non-minified file I.z.isStorybookMode()

"app-init"),
document.addEventListener("DOMContentLoaded", function() {
I.z.isStorybookMode() || (D(e),

 

Thanks

1 reply

MukeshYadav_
Community Advisor
Community Advisor
August 13, 2024

Hi @devendrabhn ,

Are you loading clientlib-dynamic-modules based on some condition or from ajax call.

$(document).ready() or DOMContentLoaded should be enough to check if elements loaded

You may remove zero class or implement logic accordingly.

I can see extra zero class attribute on first load.

Second onward load

Thanks

 

 

Level 2
August 14, 2024

Thanks @mukeshyadav_  for replying

this domId is different and is a DOM node, and class zero is not contributing to the issue

If you observe the above SS in my question, or on the site (chrome incongnito mode) and source bundle, the clientlib-dynamic-modules folder itself doesnt show up in 1st attempt to load. In 2nd attempt onwards its loads fine and keep running fine for next few hours

MukeshYadav_
Community Advisor
MukeshYadav_Community AdvisorAccepted solution
Community Advisor
August 18, 2024

Hi @devendrabhn ,

Other clientlibs are getting added via script tag like below which load as page loads

How ever dynamic clientlibs are getting called from js on some condition, which is not  fulfilled at first load.

Either check your condition in debug mode or share the code how your are adding dynamic module cleintlibs  

check and debug these condition in non-minified file I.z.isStorybookMode()

"app-init"),
document.addEventListener("DOMContentLoaded", function() {
I.z.isStorybookMode() || (D(e),

 

Thanks