Why does Sencha CMD build fail with PhantomJS error code 2?
Asked Answered
T

1

10

Problem: "Error capturing theme" while building Sencha CMD workspace application for sub-project A (has source files), but sub-project B (no source files) builds fine.

Scenario:

  1. Created new Sencha workspace (CMD 5.1.0.26) and added a new project A.
  2. Project A builds fine (sencha app build -c production)
  3. I add a main view and reference a module contained in a common folder (/project/common/js/).

  4. sencha app watch works fine however sencha app build -c production now fails on Project A.

  5. To sanity check, I generate a new application inside my framework folder, referencing the same ExtJS version (5.1.0.107), let's call it project B, and it builds just fine.

Project A is still failing with this error:

[INF] Writing content to /MyWorkspace/ProjectA/sass/example/bootstrap.json
[INF] Writing content to /MyWorkspace/ProjectA/sass/example/bootstrap.js
[INF] Capturing theme image
[ERR] loading page /MyWorkspace/ProjectA/sass/example/theme.html
== Unhandled Error ==
TypeError: '''undefined''' is not a function (evaluating '''Ext.require([
    '''Ext.layout.Context'''
])''')

  file:///MyWorkspace/ext/packages/ext-theme-base/sass/example/render.js:7

[ERR]
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.ExProcess: phantomjs process exited with code 2
[ERR]
[ERR] Total time: 46 seconds
[ERR] The following error occurred while executing this line:
/MyWorkspace/ProjectA/.sencha/app/slice-impl.xml:306: The following error occurred while executing this line:
/MyWorkspace/ProjectA/.sencha/app/slice-impl.xml:307: The following error occurred while executing this line:
/MyWorkspace/ProjectA/.sencha/app/slice-impl.xml:163: com.sencha.exceptions.ExProcess: phantomjs process exited with code 2

Workaround: I've prevented the error for now by editing sencha.cfg and adding the line: skip.slice=1

However files in /MyWorkspace/ProjectA/sass/ are the same between the failing Project A and Project B with the exception that the content differs slightly in files that reference the application names, but that is all.

The ExtJS files are few enough that I've done a manual walk through of the differences, with the exception of bootstrap.json which didn't lend itself to anymore than a visual skim.

I'd be most interested if anyone has pointers as to what is likely missing or different between these projects that appears to be causing part of my framework to be missing when it's needed in evaluating line 7 of render.js.

Let me know if you need more supporting information. Thanks!

Trinitroglycerin answered 1/2, 2015 at 19:1 Comment(1)
I found a topic on forum, sencha.com/forum/showthread.php?256848-Problems-building-themes. I guess this "theme.html" is rendered by phantomjs internally. But, it seems it's not working now.Fisticuffs
N
1

While building extjs application we have got this error

com.sencha.exceptions.ExProcess: phantomjs process exited with code 1

Solution:

We downloaded the latest version of phantomjs from here and replaced the phantomjs.exe file with cmd

phantomjs.exe "cmd/bin.windows/phantomjs/phantomjs.exe"

It worked for us.

Nady answered 25/9, 2020 at 17:36 Comment(2)
The question is about exit with error code 2, are you sure it address the same issue?Melaniamelanic
I've encountered the same error when my Internet connection was down while building the appCynical

© 2022 - 2024 — McMap. All rights reserved.