<?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.Loader.define of undefined</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=86192851" />
  <subtitle>Liferay.Loader.define of undefined</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=86192851</id>
  <updated>2026-06-03T02:32:28Z</updated>
  <dc:date>2026-06-03T02:32:28Z</dc:date>
  <entry>
    <title>RE: Liferay.Loader.define of undefined</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86258846" />
    <author>
      <name>John Schulz</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86258846</id>
    <updated>2017-02-20T14:43:19Z</updated>
    <published>2017-02-20T14:43:19Z</published>
    <summary type="html">Thanks Chema!</summary>
    <dc:creator>John Schulz</dc:creator>
    <dc:date>2017-02-20T14:43:19Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay.Loader.define of undefined</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86256824" />
    <author>
      <name>Chema Balsas</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86256824</id>
    <updated>2017-02-20T14:37:44Z</updated>
    <published>2017-02-20T14:37:44Z</published>
    <summary type="html">Hey John,&lt;br /&gt;&lt;br /&gt;Unless you are manually doing &lt;span style="font-family: Courier New"&gt;require&lt;/span&gt; or &lt;span style="font-family: Courier New"&gt;define&lt;/span&gt; calls, &lt;strong&gt;you shouldn&amp;#39;t need to change anything&lt;/strong&gt;. Even then, you wouldn&amp;#39;t necessarily need to change those. If you&amp;#39;re sure your admins will never hide the Liferay Loader, then the global methods will always be exposed.&lt;br /&gt;&lt;br /&gt;Once GA4 is out, you can keep using the new versions of the gradle plugins normally and all the code should work for you.</summary>
    <dc:creator>Chema Balsas</dc:creator>
    <dc:date>2017-02-20T14:37:44Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay.Loader.define of undefined</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86255493" />
    <author>
      <name>John Schulz</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86255493</id>
    <updated>2017-02-20T12:55:42Z</updated>
    <published>2017-02-20T12:55:42Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Thank you Severin!!!!&lt;br&gt;Lifesaver!  I was honestly stuck.  I appreciate the quick response.&lt;br&gt;&lt;br&gt;Chema, what kind of change will be required when GA4 is released...will we simply call&lt;br&gt;&lt;pre&gt;&lt;code&gt;Liferay.Loader.define(...)&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;as documented?&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>John Schulz</dc:creator>
    <dc:date>2017-02-20T12:55:42Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay.Loader.define of undefined</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86236006" />
    <author>
      <name>Chema Balsas</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86236006</id>
    <updated>2017-02-20T08:03:03Z</updated>
    <published>2017-02-20T08:03:03Z</published>
    <summary type="html">Hey John, Severin,&lt;br /&gt;&lt;br /&gt;Based on community feedback, we implemented a way to &lt;a href="https://issues.liferay.com/browse/LPS-68298"&gt;Hide Liferay&amp;#39;s AMD Loader&lt;/a&gt;. To do this, we now always namespace the previously global &lt;span style="font-family: Courier New"&gt;require&lt;/span&gt; and &lt;span style="font-family: Courier New"&gt;define&lt;/span&gt; methods.&lt;br /&gt;&lt;br /&gt;All the generated code points to the namespaced version of those methods so everything works even if the admin decides to hide it from the global scope.&lt;br /&gt;&lt;br /&gt;This was backported and will be available as soon as GA4 is released, so in the meantime, you should use  an older version of the gradle plugins or some kind of workaround as Severin pointed out.&lt;br /&gt;&lt;br /&gt;Sorry for the inconvenience &lt;img alt="emoticon" src="@theme_images_path@/emoticons/sad.gif" &gt;</summary>
    <dc:creator>Chema Balsas</dc:creator>
    <dc:date>2017-02-20T08:03:03Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay.Loader.define of undefined</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86223859" />
    <author>
      <name>Severin Rohner</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86223859</id>
    <updated>2017-02-19T21:46:48Z</updated>
    <published>2017-02-19T21:46:48Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi John&lt;br&gt;On Friday I faced the same issue. My quick workaround was to add the JavaScript &lt;pre&gt;&lt;code&gt;Liferay.Loader = Loader;&lt;/code&gt;&lt;/pre&gt; before I was loading the module. (With Liferay Workspace 1.2.4)&lt;br&gt;If you use Liferay Workspace 1.2.0 (file settings.gradle) the transpile code in the build folder starts with &lt;pre&gt;&lt;code&gt;define("js-logger@&lt;/code&gt;&lt;/pre&gt;, with version 1.2.4 it starts with &lt;pre&gt;&lt;code&gt;Liferay.Loader.define("js-logger@&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;IMHO the Liferay Workspace has implemented new "features" they aren't int Liferay 7 GA3. So hopefully there will be soon the GA4!&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Severin Rohner</dc:creator>
    <dc:date>2017-02-19T21:46:48Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay.Loader.define of undefined</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86193260" />
    <author>
      <name>John Schulz</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86193260</id>
    <updated>2017-02-17T21:25:08Z</updated>
    <published>2017-02-17T21:25:08Z</published>
    <summary type="html">Please see attached &lt;strong&gt;js-logger&lt;/strong&gt; module and &lt;strong&gt;blade.portlet.jsp&lt;/strong&gt; modules for source code.&lt;br /&gt;&lt;br /&gt;Thank you,&lt;br /&gt;John</summary>
    <dc:creator>John Schulz</dc:creator>
    <dc:date>2017-02-17T21:25:08Z</dc:date>
  </entry>
  <entry>
    <title>Liferay.Loader.define of undefined</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86192850" />
    <author>
      <name>John Schulz</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=86192850</id>
    <updated>2017-02-17T20:43:30Z</updated>
    <published>2017-02-17T20:43:30Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I'm trying to get started exposing Liferay 7 es2015 modules to other portlets by following this tutorial:  &lt;pre&gt;&lt;code&gt;https://github.com/liferay/liferay-docs/tree/master/develop/tutorials/code/osgi/modules/js-logger&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;But I'm not able to &lt;strong&gt;blade deploy&lt;/strong&gt; the module without removing the the &lt;strong&gt;module.config.generator&lt;/strong&gt; dependency on line 17 of the build.gradle file:  &lt;pre&gt;&lt;code&gt;classpath group: "com.liferay", name: "com.liferay.gradle.plugins.js.module.config.generator", version: "1.0.22"&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Otherwise, I will get this error in Terminal after trying to &lt;strong&gt;blade deploy&lt;/strong&gt; the module:&lt;br&gt;&lt;pre&gt;&lt;code&gt;
Error
  0. [ExceptionTransformer.transform] org.gradle.tooling.BuildException: Could not fetch model of type 'CustomModel' using Gradle distribution 'https://services.gradle.org/distributions/gradle-3.0-bin.zip'.
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;So if i remove the generator dep and deploy, then deploy a portlet that requires it with aui in the &lt;strong&gt;view.jsp&lt;/strong&gt; like this:&lt;br&gt;&lt;pre&gt;&lt;code&gt;
	&amp;lt;aui:script require="js-logger/logger.es"&amp;gt;
		var Logger = jsLoggerLoggerEs.default;

		var loggerOne = new Logger('*** -&amp;amp;gt; ');
		loggerOne.log('Hello');

		var loggerDefault = new Logger();
		loggerDefault.log('World');
	&amp;lt;/aui:script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;I get the following error in the browser console:&lt;br&gt;&lt;pre&gt;&lt;code&gt;Uncaught TypeError: Cannot read property 'define' of undefined&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
Which points to Liferay.Loader.define("js-logger@1.0.0/utils/log.es", ["exports"], function (exports) {
	"use strict";

	Object.defineProperty(exports, "__esModule", {
		value: true
	});

	exports.default = function (msg) {

		document.getElementById("context").innerHTML += msg + ' ';
	};
});
//# sourceMappingURL=log.es.js.map
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;What am I doing wrong???&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>John Schulz</dc:creator>
    <dc:date>2017-02-17T20:43:30Z</dc:date>
  </entry>
</feed>
