简体   繁体   English

为什么 Sencha CMD 构建失败并显示 PhantomJS 错误代码 2?

[英]Why does Sencha CMD build fail with PhantomJS error code 2?

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.问题:为子项目 A(有源文件)构建 Sencha CMD 工作区应用程序时“捕获主题出错”,但子项目 B(无源文件)构建正常。

Scenario:设想:

  1. Created new Sencha workspace (CMD 5.1.0.26) and added a new project A.创建了新的 Sencha 工作区(CMD 5.1.0.26)并添加了一个新项目 A。
  2. Project A builds fine ( sencha app build -c production )项目 A 构建良好( sencha app build -c production
  3. I add a main view and reference a module contained in a common folder (/project/common/js/).我添加了一个主视图并引用了一个包含在公共文件夹 (/project/common/js/) 中的模块。

  4. sencha app watch works fine however sencha app build -c production now fails on Project A. sencha app watch工作正常,但是sencha app build -c production现在在项目 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.为了完整性检查,我在我的框架文件夹中生成了一个新应用程序,引用相同的 ExtJS 版本 (5.1.0.107),我们称之为项目 B,它构建得很好。

Project A is still failing with this error:项目 A 仍然因此错误而失败:

[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解决方法:我现在通过编辑sencha.cfg并添加以下行来防止该错误: 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.然而, /MyWorkspace/ProjectA/sass/中的文件在失败的项目 A 和项目 B 之间是相同的,除了引用应用程序名称的文件中的内容略有不同,但仅此而已。

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. ExtJS 文件很少,我已经手动浏览了差异,但bootstrap.json除外,它仅用于视觉浏览。

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 .如果有人指出这些项目之间可能缺少或不同的内容,在评估render.js第 7 render.js似乎导致我的框架的一部分丢失,我会最感兴趣。

Let me know if you need more supporting information.如果您需要更多支持信息,请告诉我。 Thanks!谢谢!

While building extjs application we have got this error在构建 extjs 应用程序时,我们遇到了这个错误

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,并用cmd替换了phantomjs.exe文件

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

It worked for us.它对我们有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM