RE: Gulp.watch starting correctly but removing the installed theme

Claudio Ferraro, modified 7 Years ago. New Member Posts: 9 Join Date: 11/6/18 Recent Posts

Hello guys.

We followed this guide:

https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-1/automatically-deploying-theme-changes

on liferay-ce-portal-7.1.0-ga1 and liferay-ce-portal-7.1.1-ga2

in order to publish our changes automatically (HOT) to our localhost tomcat environment.

Sadly as we execute the "gulp watch" command , the proxy is created and a new test environment is created correctly as well, but our theme installed looks to be dropped off from the Bundle and on the terminal we can see this error:

[http-nio-8080-exec-6][ThemeLocalServiceImpl:230] No theme found for specified theme id [theme_id]. Returning the default theme.

 

Also in the osgi/war folder of the bundle there is no more WAR file of our template.

We can still deploy again the theme but if we change some static content, maybe a css inside our theme , the change is not reflected in the Test Proxy Environment.

Even a browser refresh doesn't help.

Developer mode is enabled.

We use this config.

theme.css.fast.load=false
theme.css.fast.load.check.request.parameter=true
theme.images.fast.load=false
theme.images.fast.load.check.request.parameter=true

javascript.fast.load=true
javascript.log.enabled=false

layout.template.cache.enabled=false

thumbnail
Iacopo Colonnelli, modified 7 Years ago. New Member Posts: 2 Join Date: 8/18/15 Recent Posts

Ciao Claudio,

The fact that the deployed theme is removed from the osgi/war folder is correct. Watch task needs to deploy its own version of the theme in order to be able to fast deploy modified files instead of recompiling the whole thing. And the fact that if you redeploy the whole thing you loose the fast deployment is correct too, because you are deploying a normal version of the bundle which isn't able to deal with this kind of updates.

What is not correct is the fact that Liferay isn't able to see the theme when deployed with gulp watch. The involved jar should be created inside .web_bundle_build folder, which should be the one pointed by the "appServerPathPlugin" inside your liferay-theme.json. Then the watch task executes a GoGo Shell connection on your localhost:11311 port by default to initialize a watch socket on the server. If you are in developer mode, the port should be open. Do you see any error message on Liferay console related to WabDeployer or something like that?

If not, maybe you can try to simply reassign the theme to your site after launching gulp watch. If you go to Public Pages or Private Pages and click the "Change Current Theme" button, do you see your theme among the options?

Let me know if some of these suggestions did help you ^_^

In bocca al lupo

Claudio Ferraro, modified 7 Years ago. New Member Posts: 9 Join Date: 11/6/18 Recent Posts
Ciao Iacopo,
Thank You for Your involvement, I really appreciate it.
I,
-Installed a fresh instance of Liferay Tomcat bundle (7.1.1 GA2).
-Enabled Developer mode.
-Updated Yeoman Theme generator.
-Created a new theme with it.
-Ran "gulp deploy", which worked just fine ("2018-11-21 11:34:50.965 INFO  [fileinstall-D:/Gulp_watch_issue/liferay-ce-portal-7.1.1-ga2/osgi/war][ThemeHotDeployListener:108] 1 theme for test-theme is available for use")
-Then ran "gulp watch", which unregistered and stopped the "test-theme", and then launched a proxy on localhost:9080.
The tomcat console only showed
"2018-11-21 11:35:51.049 INFO  [fileinstall-D:/Gulp_watch_issue/liferay-ce-portal-7.1.1-ga2/osgi/war][ThemeHotDeployListener:171] 1 theme for test-theme was unregistered
2018-11-21 11:35:51.083 INFO  [fileinstall-D:/Gulp_watch_issue/liferay-ce-portal-7.1.1-ga2/osgi/war][BundleStartStopLogger:42] STOPPED test-theme_1.0.0 [946]"
Which I believe is not the only thing that is supposed to happen.
I have also checked the .web_bundle_build, and there is no .jar file there.
It was there before all updates I have performed, however it still was not working properly then.

Here is my liferay-theme.json file contents:
{
  "LiferayTheme": {
    "deploymentStrategy": "LocalAppServer",
    "appServerPath": "D:\\Gulp_watch_issue\\liferay-ce-portal-7.1.1-ga2\\tomcat-9.0.10",
    "deployPath": "D:\\Gulp_watch_issue\\liferay-ce-portal-7.1.1-ga2\\deploy",
    "url": "http://localhost:8080",
    "appServerPathPlugin": "D:\\Gulp_watch_issue\\test-theme\\.web_bundle_build",
    "deployed": true,
    "pluginName": "test-theme",
    "webBundleDir": "watching"
  }
}

and my package.json if it will be helpful at all
{
 "devDependencies": {
  "gulp": "3.9.1",
  "liferay-theme-tasks": "8.0.0-beta.5",
  "liferay-theme-deps-7.1": "8.0.0-beta.5"
 },
 "keywords": [
  "liferay-theme"
 ],
 "liferayTheme": {
  "baseTheme": "styled",
  "screenshot": "",
  "rubySass": false,
  "templateLanguage": "ftl",
  "version": "7.1"
 },
 "main": "package.json",
 "name": "test-theme",
 "version": "1.0.0"
}

I hope it helps You get a better picture of the situation.
thumbnail
Chema Balsas, modified 7 Years ago. Regular Member Posts: 127 Join Date: 2/25/13 Recent Posts

Hey Claudio, the problem you're seeing has been reported at liferay-themes-sdk#102 . You can track it there.

 

As far as we've been able to observe, there's some problem right now with the Gogo Shell, wich is not properly handling our watch mechanism. You can see LPS-86972 and LPS-87487 for more information about this.

 

We're looking into this, hope to be able to figure it out soon.