<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Liferay DXP 7.4 supports Angular 19 custom element client extensions?</title>
  <link rel="self" href="https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=123281607" />
  <subtitle>Liferay DXP 7.4 supports Angular 19 custom element client extensions?</subtitle>
  <id>https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=123281607</id>
  <updated>2026-04-07T20:32:35Z</updated>
  <dc:date>2026-04-07T20:32:35Z</dc:date>
  <entry>
    <title>RE: RE: Liferay DXP 7.4 supports Angular 19 custom element client extensions?</title>
    <link rel="alternate" href="https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123443999" />
    <author>
      <name>Iacopo Valentini</name>
    </author>
    <id>https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123443999</id>
    <updated>2025-06-23T17:36:02Z</updated>
    <published>2025-06-13T05:51:22Z</published>
    <summary type="html">&lt;p&gt;I add a few lines as we were able to run some Angular projects in our
  test environments.&lt;/p&gt;
&lt;p&gt;What David says is correct you have to convert the main angular
  component to a&lt;strong&gt; Standard Web&lt;/strong&gt; component and create a
    &lt;strong&gt;Custom Element&lt;/strong&gt;, we used &lt;em&gt;
    &lt;strong&gt;@angular/elements&lt;/strong&gt;
  &lt;/em&gt; for our tests. This step is important otherwise the application
  will never load within Liferay. For its implementation be careful as
  it changes slightly depending on the versions of Angular (at least in
  our tests we tested v.17, 19 and 20).&lt;/p&gt;
&lt;p&gt;Another thing that was blocking us from properly running the
  application in Liferay was the lack of the &lt;em&gt;
    &lt;strong&gt;&amp;quot;import ‘zone.js’ &amp;quot;&lt;/strong&gt;
  &lt;/em&gt; in the &lt;strong&gt;main.ts&lt;/strong&gt; file of the project. On this I
  cannot give you any other explanation unfortunately, but by simply
  adding this import the application started without any error.&lt;/p&gt;
&lt;p&gt;The last step we had to do was to configure in the
  &lt;strong&gt;app.config.ts&lt;/strong&gt; the HashLocationStrategy as our
  LocationStrategy, maybe it is not an elegant solution and if there are
  anchors in the application it could create problems, but in this way
  there is no risk that angular interprets the Liferay friendlyUrl urls
  as its own route and goes in error.&lt;/p&gt;
&lt;p&gt;I hope I have helped!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Iacopo Valentini</dc:creator>
    <dc:date>2025-06-13T05:51:22Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay DXP 7.4 supports Angular 19 custom element client extensions?</title>
    <link rel="alternate" href="https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123443692" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123443692</id>
    <updated>2025-06-12T14:02:31Z</updated>
    <published>2025-06-12T14:02:30Z</published>
    <summary type="html">&lt;p&gt;Client extensions in Angular 19 can work, but your Angular code must
  be in the form of a &lt;strong&gt;standard web component&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If you're not building &lt;strong&gt;standard web components&lt;/strong&gt;,
  you're going to face problems.&lt;/p&gt;
&lt;p&gt;You can ask chatgpt or gemini or the others to help you migrate your
  angular 19 app to be a &lt;strong&gt;standard web component&lt;/strong&gt;, they
  can help with the conversion. It's not going to change the
  fundamentals of your application, just the packaging and stuff.&lt;/p&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2025-06-12T14:02:30Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay DXP 7.4 supports Angular 19 custom element client extensions?</title>
    <link rel="alternate" href="https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123441207" />
    <author>
      <name>Iacopo Valentini</name>
    </author>
    <id>https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123441207</id>
    <updated>2025-06-12T13:37:03Z</updated>
    <published>2025-06-11T06:43:01Z</published>
    <summary type="html">&lt;p&gt;I am facing a similar error. I have an Angular 19 application running
  on a remote server, and I set the client extension to point to the
  main.js, polyfils.js, and style.css files.&lt;/p&gt;
&lt;p&gt;When I try to load the application into the page it doesn't load
  right away and generates an error.&lt;/p&gt;
&lt;p&gt;The strange thing is that if I create a new page with the same CX
  when I navigate to the second page the angular application loads
  correctly and then stops working the moment you do a browser page
  refresh or go to another portal page.&lt;/p&gt;
&lt;p&gt;What I would like to understand is if you have to modify the Anguar
  project in some specific way or if you have to do some Liferay side configurations.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Iacopo Valentini</dc:creator>
    <dc:date>2025-06-11T06:43:01Z</dc:date>
  </entry>
  <entry>
    <title>Liferay DXP 7.4 supports Angular 19 custom element client extensions?</title>
    <link rel="alternate" href="https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123281606" />
    <author>
      <name>Raul Duenas</name>
    </author>
    <id>https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123281606</id>
    <updated>2025-03-13T20:14:51Z</updated>
    <published>2025-03-06T19:30:21Z</published>
    <summary type="html">&lt;p&gt;I had created a custom element client extension, based on an Angular
  19 application.  The applicantion runs fine outside Liferay, but when
  I use the client extension from a page in Liferay, it does not load,
  with a javascript error:&lt;/p&gt;
&lt;p&gt;main-P7JQYSSB.js?t=1741218955318:8  Uncaught TypeError:
  Ae.process.toString is not a function&lt;br&gt;     at
  main-P7JQYSSB.js?t=1741218955318:8:154113&lt;br&gt;
  polyfills-OEPZ4W45.js?t=1741218955318:1  Uncaught TypeError:
  Y.process.toString is not a function&lt;br&gt;     at polyfills-OEPZ4W45.js?t=1741218955318:1:11222&lt;/p&gt;
&lt;p&gt;The line that triggers the error is inside the file zone.js of Angular:&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-javascript"&gt;const isNode = !('nw' in _global) &amp;amp;&amp;amp;
    typeof _global.process !== 'undefined' &amp;amp;&amp;amp;
    _global.process.toString() === '[object process]';&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;it seems that Angular is trying to detect if it runs on a nodejs
  enviroment, accessing the process attribute in the _global variable. 
  In the browser, this _global variable points to the window object and
  does not have a process attribute. Unfortunately in the Liferay
  enviroment the window object has a process attribute of type Module,
  and this attribute does not have the toString() method, so the
  bootstrap fails.&lt;/p&gt;
&lt;p&gt;Is it possible add the toString() property to the process attribute
  in the window object in some point of the client extension?&lt;/p&gt;
&lt;p&gt;Thank you for your advise&lt;/p&gt;</summary>
    <dc:creator>Raul Duenas</dc:creator>
    <dc:date>2025-03-06T19:30:21Z</dc:date>
  </entry>
</feed>
