Legacy Knowledge Base
Published Jul. 2, 2025

Custom portlet on DXP 7.2 triggers error 'TypeError: Liferay.Loader.addModule is not a function'

Written By

József Géczi

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • As a developer, I would like to use function addModule in my custom portlet on DXP 7.2 the same way I did in case of 7.1 as well.
  • However, after deploy the following errors are shown in browser console:
TypeError: Liferay.Loader.addModule is not a function

and

Error: The following problems where detected while resolving modules: Missing required module '[...]'

Environment

  • Liferay DXP 7.2

Resolution

  • The reason of getting the error messages is the fact addModule function has been removed from DXP 7.2 by design.
  • The technical reasoning behind is the following new approach of handling modules: all module resolutions are aimed to be applied on the server side in order to boost speed and network performance. It also means no module shall be added on the client side because the server wouldn't know about them and wouldn't be able to resolve it.
  • Please provide a detailed description of the particular use case and elaborate what is desired to achieve exactly by using addModule.
  • With all these additional information, Liferay Support may involve the Product Team and ask for suggesting a possible alternative method, if applicable.
Did this article resolve your issue ?

Legacy Knowledge Base