GWT SuperDevMode抛出此信息:找到多个片段0源图。排列太多

时间:2012-12-11 11:24:16

标签: gwt gwt-2.5 source-maps

我正在使用SuperDevMode和Chrome,它一直运行正常,直到源图停止在Chrome中停止显示。
CodeServer引发以下异常:Multiple fragment 0 sourcemaps found. Too many permutations.

在编译期间显示:

Compiling 5 permutations
  Compiling permutation 0...
  Source Maps Enabled
  Compiling permutation 1...
  Source Maps Enabled
  Compiling permutation 2...
  Source Maps Enabled
  Compiling permutation 3...
  Source Maps Enabled
  Compiling permutation 4...
  Source Maps Enabled
Compile of permutations succeeded

有什么想法吗?

2 个答案:

答案 0 :(得分:4)

默认情况下,GWT会编译6个基本排列,每个浏览器类别一个。

  • Firefox,所有版本
  • 所有Webkit浏览器(Safari,Chrome,Android浏览器等)
  • IE6和IE7
  • IE8
  • IE9(和IE10)

有一个报道的问题:Issue 7458: Super Dev Mode shouldn't compile 6 permutations when user.agent is missing

问题说明中建议的解决方法:

  

是限制gwt.xml文件中的浏览器排列。例如,如果您使用的是Chrome或Safari:

<set-property name="user.agent" value="safari"/>

此外,如果您使用的是Sencha GXT,我还建议您浏览以下文章:Using the GWT Compiler for Better Builds

根据文章,我还在我的gwt.xml中添加了以下行:

<collapse-all-properties />

最后我的SuperDev模式配置如下:

<add-linker name="xsiframe"/>
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
<set-property name="compiler.useSourceMaps" value="true" />
<set-property name="user.agent" value="safari"/>
<collapse-all-properties />

结果GWT只编译一个排列:

binding: user.agent=safari
binding: compiler.useSourceMaps=true
binding: locale=en
Compiling module com.mycompany.Main
...
Compiling 1 permutation
  Compiling permutation 0...
  Source Maps Enabled
Compile of permutations succeeded

答案 1 :(得分:2)

如果您添加区域设置但未明确添加en区域设置和/或未“删除”default区域设置,则可能会发生这种情况在浏览器中加载页面之前,开发模式关闭

例如,在我的模块中,我有:

<extend-property name="locale" values="fr" />
<set-property-fallback name="locale" value="fr"/>

使用此设置,有2个区域设置:frdefault(但不再使用default区域设置,因为我将回退覆盖为fr)。

启动SuperDevMode时,它会编译2个排列(可能是因为它会强制localeen,但实际上并不会检查模块中是否存在这样的区域设置。)

我之前已启动该应用并启用 Dev Mode On ,但随后停止并重新启动SuperDevMode。当我在Chrome中刷新页面时,因为它仍然是处于开发模式(状态存储在localStorage中),它会从SuperDevMode加载脚本并尝试立即加载源地图,这失败了,因为SuperDevMode编译了2个排列,而不只是一个 单击开发模式编译会强制SuperDevMode使用浏览器环境中的属性重新编译(此处为locale=fr,因为它是后备)。因此,它编译了单个排列,并且源图再次起作用。

在我的具体案例中,我需要一个单一的排列;我所要做的就是添加<set-property name="locale" value="fr"/>

你必须处于类似情况。

对不起,这是我可以分享的所有信息。没什么权威的。