从EXTJS 4.2升级到EXTJS 6.x后出现错误 [英] Errors After Upgrading from EXTJS 4.2 to EXTJS 6.x

查看:3148
本文介绍了从EXTJS 4.2升级到EXTJS 6.x后出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我已经通过两种方式完成了升级:



1)我设置了一个新的 sencha app生成[appName] 并将 4.2 文件和目录传输到 6.x 。设置完成后,执行 sencha app build 时会发生错误:

 执行此行时出现以下错误:
/var/www/html/backoffice-test/EcommBackoffice/.sencha/app/build-impl.xml:381:执行此行时发生以下错误:
/var/www/html/backoffice-test/EcommBackoffice/.sencha/app/init-impl.xml:382:com.sencha.exceptions.ExNotFound:依赖关系的未知定义:Ext.ux.grid.filters 。$ f pre













与此同时,加载应用程序时,控制台错误发出以下行:

  http:// localhost:1841 / EcommBackoffice /覆盖/查看/ Table.js?_dc = 1452581765612` 
http:// localhost:1841 / EcommBackoffice /覆盖/选择/ Model.js?_dc = 1452581765612`
[E ] [Ext.Loader]某些请求的文件加载失败。
[E] [Loader]以下类无法加载:
[E] [Loader]覆盖/ view / Table.js的覆盖.view.Table
[E] [Loader] Overrides.selection.Model from Overrides / selection / Model.js
[E] [Loader] EcommBackoffice.Application from app / Application.js

2)被贴在第一个,我的第二个方法是简单地做一个 sencha app upgrade -ext 现有应用程序。它成功更新,除了做一个 sencha应用程序构建它发出类似的错误,如:

 执行此行时出现以下错误:
/var/www/html/backoffice-2.0/src/main/webapp/.sencha/app/build-impl.xml:381:执行此行时出现以下错误:
/var/www/html/backoffice-2.0/src/main/webapp/.sencha/app/init-impl.xml:382:com.sencha.exceptions.ExNotFound:未知的依赖定义:Ext.ux.grid.FiltersFeature

和一个简短的控制台错误:未捕获ReferenceError:Ext未定义



当我编辑 index.html 并替换 x-compile 片段:

  ! - < x-compile> - > 

<! - < x-bootstrap> - >
< link rel =stylesheethref =bootstrap.css>
< script src =ext / ext-all-debug-w-comments.js>< / script>
< script src =bootstrap.js>< / script>
<! - < / x-bootstrap> - >
< script src =app.js>< / script>

<! - < / x-compile> - >

到:

 < script id =microloaderdata-app =a32fd6d2-db0c-4c4b-a6a2-4185b3ee3fd4type =text / javascriptsrc =bootstrap.js>< / script> 

在编辑 index.html 之前, x-compile 引发了不同的错误:

  /。sencha /app/init-impl.xml:382:com.sencha.exceptions.ExBuild:混合模式x编译和微量加载当前不受支持

这就是为什么我选择了由6.x提供的支持的Microloader的原因



我在这里很失落。 ExtJS显然没有适当的Sencha指南,可以直接从 4.x升级到6.x 。它只进行一步更高的升级,例如 4.x至5.x ,以及 5.x至6.x 。即使这样,这些指南也不是很清楚,而且IMHO缺少文档。



任何人谁可以指出问题所在,我提供的错误?

解决方案

嗯,Cmd错误消息说得很清楚:

 依赖关系的未知定义:Ext.ux.grid.filters.Filters 

这意味着ExtJS6不提供 Ext.ux.grid.filter.Filters ,这在你的应用程序中是必需的。



如Ext文档所述,从$ code> Ext.ux 命名空间的所有内容都不是升级安全的,因为它是用户提供的内容,Sencha已经发现有用和添加到Ext zip文件。通常,您只需在互联网上搜索ExtJS 6.0.x实现的官方zip文件中缺少的ux功能;或者自己写。



但是,对于你的特殊情况,我相信他们将网络过滤器从ux转移到ExtJS 4.2.x中的官方分支,然后删除ExtJS中的别名5,最后,在ExtJS 6中,他们用插件替换了这个功能。



所以请看一下 Ext.grid.filters.Filters ,我相信它会执行你所需要的,但你必须重写部分代码才能使用它。 (更改需求,将参考从功能移动到插件,可能会考虑其他更改。)



我认为第二个错误消息([E] [Ext。装载器]一些请求的文件加载失败。)与第一个文件相同,我希望像需要:['Ext.ux.grid.filters.Filters'] 覆盖/ view / Table.js 。 ( Overrides.selection.Model 未加载,因为它需要 Overrides.view.Table EcommBackoffice.Application 未加载,因为它引用 Overrides.selection.Model


So far, I've done the upgrade in two ways:

1) I set up a fresh sencha app generate [appName] and transferred the 4.2 files and directories to 6.x. After setting them up, an error occurs when doing a sencha app build:

The following error occurred while executing this line:
/var/www/html/backoffice-test/EcommBackoffice/.sencha/app/build-impl.xml:381: The following error occurred while executing this line:
/var/www/html/backoffice-test/EcommBackoffice/.sencha/app/init-impl.xml:382: com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Ext.ux.grid.filters.Filters
rareyes@MAKDL-RAREYES:/var/www/html/backoffice-test/EcommBackoffice$

Along with this, upon loading the app, the console error is giving out these lines:

http://localhost:1841/EcommBackoffice/Overrides/view/Table.js?_dc=1452581765612`
http://localhost:1841/EcommBackoffice/Overrides/selection/Model.js?_dc=1452581765612`
[E] [Ext.Loader] Some requested files failed to load.
[E] [Loader] The following classes failed to load:
[E] [Loader] Overrides.view.Table from Overrides/view/Table.js
[E] [Loader] Overrides.selection.Model from Overrides/selection/Model.js
[E] [Loader] EcommBackoffice.Application from app/Application.js

2) Being stucked on the first one, my second approach was to simply do a sencha app upgrade -ext on the existing application. It successfully updated except when doing a sencha app build it gives out a similar error such as:

The following error occurred while executing this line:
/var/www/html/backoffice-2.0/src/main/webapp/.sencha/app/build-impl.xml:381: The following error occurred while executing this line:
/var/www/html/backoffice-2.0/src/main/webapp/.sencha/app/init-impl.xml:382: com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Ext.ux.grid.FiltersFeature

and a short console error of: Uncaught ReferenceError: Ext is not defined

This occurs when I edit index.html and replace x-compile snippet:

<!-- <x-compile> -->

<!-- <x-bootstrap> -->
<link rel="stylesheet" href="bootstrap.css">
<script src="ext/ext-all-debug-w-comments.js"></script>
<script src="bootstrap.js"></script>
<!-- </x-bootstrap> -->
<script src="app.js"></script>

<!-- </x-compile> -->

to this:

<script id="microloader" data-app="a32fd6d2-db0c-4c4b-a6a2-4185b3ee3fd4" type="text/javascript" src="bootstrap.js"></script>

Prior to editing index.html, a different error is being thrown with x-compile:

/.sencha/app/init-impl.xml:382: com.sencha.exceptions.ExBuild: Mixed-Mode x-compile and microload markup is currently unsupported

This is the reason why I opted for the supported Microloader provided by 6.x

I am quite on a lost here. ExtJS apparently has no proper Sencha guide to upgrade directly from 4.x to 6.x. It only does a one step higher upgrade such as 4.x to 5.x, and 5.x to 6.x. Even then, the guide for these are not very clear and IMHO, lacks documentation.

Anyone who can point where the problem is with the errors I provided?

解决方案

Well, the Cmd error message says it loud and clear:

Unknown definition for dependency : Ext.ux.grid.filters.Filters

This means that ExtJS6 does not provide Ext.ux.grid.filter.Filters, which is required somewhere in your application.

As the Ext documentation states, everything from Ext.ux namespace is not upgrade-safe, because it is user-provided content that Sencha has found useful and added to the Ext zip file. Normally, you would just search the internet for available ExtJS 6.0.x implementations of the ux features that are missing from the official zip file; or write them yourself.

But for your special case, I believe that they moved gridfilters from ux into the official branch in ExtJS 4.2.x, then removed the alias in ExtJS 5, and finally, in ExtJS 6, they replaced the feature with a plugin.

So please have a look at Ext.grid.filters.Filters, I believe it does what you need, but you would have to rewrite parts of your code to make use of it. (change the require, move the reference from features to plugins, possibly account for other changes.)

I think that the second error message ("[E] [Ext.Loader] Some requested files failed to load.") means the same as the first one, and I would expect something like requires:['Ext.ux.grid.filters.Filters'] in Overrides/view/Table.js. (Overrides.selection.Model isn't loaded because it requires Overrides.view.Table, and EcommBackoffice.Application isn't loaded because it references Overrides.selection.Model)

这篇关于从EXTJS 4.2升级到EXTJS 6.x后出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆