liferay / liferay-theme-tasks

A set of tasks for building and deploying Liferay Portal themes.
18 stars 24 forks source link

Error when no theme is found with gulp extend task #37

Closed GianBe closed 7 years ago

GianBe commented 7 years ago

When searching for globally installed npm modules, if no theme is found an error will appear after the message No globally installed theme found. Install some with "npm i -g [name]":

TypeError: Cannot read property 'realPath' of undefined

with an associated really long stacktrace.

This error appears when the module object passed to extend_prompt is empty, it seems like this case is not supported by the current code.

How to reproduce the error:

  1. Make sure that you don't have any theme installed globally, from a generated liferay theme directory use the gulp extend task
  2. when prompted select 1 or base theme
  3. select 3 or Search for globally installed npm modules
  4. you should see the error and the stacktrace
robframpton commented 7 years ago

Fixed with https://github.com/liferay/liferay-theme-tasks/commit/b3b4d4c31a837848b8ff1d89f10dfc2149de2a35

Note that this just prevents the error, the No globally installed theme found message is correct behavior for when it can't find any modules.