从EXTJS 4.2升级到EXTJS 6.x后出现的错误

时间:2022-04-17 18:06:16

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:

1)设置一个新的sencha app generate [appName],将4.2文件和目录转移到6.x。设置好后,在进行sencha应用程序构建时发生错误:

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:

2)在第一个问题上,我的第二个方法是简单地对现有的应用程序进行sencha应用程序升级-ext。它成功地进行了更新,但在进行sencha应用构建时,它会出现类似的错误,比如:

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

还有一个短的控制台错误:未捕获的ReferenceError: Ext没有定义。

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

这发生在我编辑索引时。html并替换x-compile代码段:

<!-- <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:

之前编辑索引。使用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

这就是为什么我选择了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.

我在这里迷路了。ExtJS显然没有合适的Sencha指南直接从4升级。x 6. x。它只做了更高一级的升级,如4。x 5。x,和5。x 6. x。即使是这样,这些指南也不是很清晰,缺乏文档。

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

谁能指出我提供的错误在哪里?

1 个解决方案

#1


1  

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

Cmd的错误信息说得很清楚:

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.

这意味着ExtJS6没有提供Ext.ux.grid.filter。过滤器,这是应用程序中需要的。

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.

正如Ext文档所述,Ext.ux命名空间中的所有内容都不是升级安全的,因为它是用户提供的内容,Sencha发现这些内容非常有用,并将其添加到Ext zip文件中。通常,您只需在internet上搜索可用的ExtJS 6.0。在官方zip文件中缺少的ux特性的x实现;或写他们自己。

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.

但是对于您的特殊情况,我认为他们将gridfilter从ux移动到ExtJS 4.2的官方分支。然后在ExtJS 5中删除了别名,最后在ExtJS 6中,他们用一个插件替换了这个特性。

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.)

请查看Ext.grid.filters。过滤器,我相信它可以满足您的需要,但是您必须重写代码的一部分才能使用它。(更改需求,将引用从特性转移到插件,可能考虑到其他更改。)

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)

我认为第二个错误信息(“[E] [Ext]”)。加载程序]一些被请求的文件未能加载。”)的意思与第一个文件相同,我期望类似require:[' ext.ux .filter .filters。在覆盖/视图/ Table.js过滤器']。(Overrides.selection。模型没有被加载,因为它需要重载。view。表,EcommBackoffice。应用程序没有被加载,因为它引用了overrid .selection. model)

#1


1  

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

Cmd的错误信息说得很清楚:

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.

这意味着ExtJS6没有提供Ext.ux.grid.filter。过滤器,这是应用程序中需要的。

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.

正如Ext文档所述,Ext.ux命名空间中的所有内容都不是升级安全的,因为它是用户提供的内容,Sencha发现这些内容非常有用,并将其添加到Ext zip文件中。通常,您只需在internet上搜索可用的ExtJS 6.0。在官方zip文件中缺少的ux特性的x实现;或写他们自己。

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.

但是对于您的特殊情况,我认为他们将gridfilter从ux移动到ExtJS 4.2的官方分支。然后在ExtJS 5中删除了别名,最后在ExtJS 6中,他们用一个插件替换了这个特性。

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.)

请查看Ext.grid.filters。过滤器,我相信它可以满足您的需要,但是您必须重写代码的一部分才能使用它。(更改需求,将引用从特性转移到插件,可能考虑到其他更改。)

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)

我认为第二个错误信息(“[E] [Ext]”)。加载程序]一些被请求的文件未能加载。”)的意思与第一个文件相同,我期望类似require:[' ext.ux .filter .filters。在覆盖/视图/ Table.js过滤器']。(Overrides.selection。模型没有被加载,因为它需要重载。view。表,EcommBackoffice。应用程序没有被加载,因为它引用了overrid .selection. model)