adobe / aem-core-forms-components

Apache License 2.0
25 stars 49 forks source link

Panel Component properties undefined error when used with Wizard, Tabs, Accordions #1261

Closed mnahmias closed 1 month ago

mnahmias commented 1 month ago

Expected Behaviour

Add a panel component to a form with a wizard, tab, or accordion component and hit preview. The form loads and functions normally.

Actual Behaviour

Add a panel component to a form with a wizard, tab, or accordion component and hit preview. The form does not load and throws a console js error.

Steps to Reproduce

  1. Add a panel component to a form with a wizard, tab, or accordion component
  2. Hit preview

Platform and Version

AEM Version (mention the exact version in case of cloud SDK)

2023.12.14697.20231215T125030Z-231200

AEM Forms Version

2023.10.25.00-231200

Sample Code that illustrates the problem

Console error:

core-forms-components-runtime-all.lc-ce437eb1c73034a6d28f565696201068-lc.min.js:4561 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'MESSAGE_CHANNEL')
    at new Wizard (core-forms-components-runtime-all.lc-ce437eb1c73034a6d28f565696201068-lc.min.js:4561:71)
    at core-forms-components-runtime-all.lc-ce437eb1c73034a6d28f565696201068-lc.min.js:5122:16
    at #r (core-forms-components-runtime-all.lc-ce437eb1c73034a6d28f565696201068-lc.min.js:1:165472)
    at core-forms-components-runtime-all.lc-ce437eb1c73034a6d28f565696201068-lc.min.js:1:166068
    at Array.forEach (<anonymous>)
    at o.initializeAllFields (core-forms-components-runtime-all.lc-ce437eb1c73034a6d28f565696201068-lc.min.js:1:165887)
    at o.setupFormContainer (core-forms-components-runtime-all.lc-ce437eb1c73034a6d28f565696201068-lc.min.js:1:167792)
    at async HTMLDocument.onDocumentReady (core-forms-components-runtime-all.lc-ce437eb1c73034a6d28f565696201068-lc.min.js:102:9)

Logs taken while reproducing problem

rismehta commented 1 month ago

@mnahmias Which version of the Forms Core Component are you using? I am unable to reproduce the issue on my end. Is the issue reproducible on the latest released version? You can check it here: core-forms-components-reactor-3.0.28.

kah8150 commented 1 month ago

Hi @rismehta thanks for looking into this. I am actually working with @mnahmias on this and can provide more context. We did also just try on v3.0.28 with the same result. Sorry there's a bit of context missing in the description of this ticket. In the edit mode of the form these components work fine. They also work fine on the published form or if you go to the form in author with ?wcmmode=disabled. However if you edit the form, and click on the Preview mode button in the upper right is when this fails and causes the entire form not to load.

rismehta commented 1 month ago

Hi @rismehta thanks for looking into this. I am actually working with @mnahmias on this and can provide more context. We did also just try on v3.0.28 with the same result. Sorry there's a bit of context missing in the description of this ticket. In the edit mode of the form these components work fine. They also work fine on the published form or if you go to the form in author with ?wcmmode=disabled. However if you edit the form, and click on the Preview mode button in the upper right is when this fails and causes the entire form not to load.

Thanks @kah8150. I am still unable to reproduce the issue on my end. Here are the steps I followed:

  1. Dropped a panel component inside a wizard.
  2. Clicked on the preview layer and also tried refreshing the page in the preview layer.

After reviewing the stack trace, it seems likely that the client library dependency core.wcm.components.commons.site.container is missing from your instance. This dependency is part of the WCM core component library, which is necessary for the wizard, tab, or accordion to function correctly.

kah8150 commented 1 month ago

@rismehta thanks for digging into this. I did see that dependency loading but I think there must have been an order of operations problem as I re-ordered where the core.wcm.components* clientlib was included and it seems to be working now. My colleague is out of the office so feel free to close this if you can, if not I will ensure it is closed when he returns. Thanks again

rismehta commented 1 month ago

@rismehta thanks for digging into this. I did see that dependency loading but I think there must have been an order of operations problem as I re-ordered where the core.wcm.components* clientlib was included and it seems to be working now. My colleague is out of the office so feel free to close this if you can, if not I will ensure it is closed when he returns. Thanks again

Thank you for confirming that the issue cannot be replicated. Please don't hesitate to open another issue if it becomes reproducible again. Closing this issue.