Issue
- While navigating through DXP pages, the browser's console will occasionally print the below error:
Error: Namespace "ClayTooltip.incrementaldom" already declared
So far the issue was observed in the following cases:
Case 1: Single Page Application enabled (javascript.single.page.application.enabled=truein portal-ext.properties)
Case 2: A clustered environment where the clustering was achieved by having:- 2 Liferay nodes
- 2 databases (1 for each instance)
- 1 Load balancer connecting the nodes
Environment
- Liferay DXP 7.0+
Resolution
- For Case 1: Ensure the links leading to the problematic page have senna disabled: https://help.liferay.com/hc/en-us/articles/360030752391-Disabling-SPA#disabling-spa-for-an-individual-element or, alternatively, that the resources aren't unloaded during navigation: https://help.liferay.com/hc/en-us/articles/360030752411-Specifying-How-Resources-Are-Loaded-During-Navigation
-
For Case 2: While the type of clustered environment having multiple databases is not supported, a temporary remediation for that is adding this property in the portal-ext.properties file:
javascript.single.page.application.enabled=false
With such property, the browser will freshly load
ClayTooltipon each navigation, avoiding the problem.
Additional Information
- https://help.liferay.com/hc/en-us/articles/360030752391-Disabling-SPA
- The type of "cluster" setup having more than one database is unsupported (Liferay requirement is to always have only one database in a cluster environment). In such case, the error happens because
ClayTooltipis loaded multiple times. - Liferay NPM Bundler with ReactJS and Clay from the Liferay Community Forums
- How can Clay components be used within a React portlet? on GitHub
- Liferay DXP Clustering guide from Liferay Docs