clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay_33_g$(...).style_86_g$ 不是函数

clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay_33_g$(...).style_86_g$ is not a function

好吧,突然间一切似乎都坏了。我不记得我改变了什么。我清理了整个项目,检查了它的旧版本,删除了所有代码服务器编译文件,重新启动了 Eclipse 等。但是我在这里收到以下错误:

Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) : this.get_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay_17_g$(...).style_48_g$ is not a function
ConsoleLogger.java:32 TypeError: this.get_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay_17_g$(...).style_48_g$ is not a function
    at Jmg_g$ [as build_style_17_g$] (HomeView_BinderImpl.java:74)
    at Dmg_g$ (HomeView_BinderImpl.java:43)
    at ymg_g$ [as createAndBindUi_17_g$] (HomeView_BinderImpl.java:31)
    at zmg_g$ [as createAndBindUi_0_g$] (HomeView_BinderImpl.java:28)
    at tmg_g$ (HomeView.java:20)
    at qng_g$ [as com$mz$client$application$admin$home$HomeView_com$mz$client$application$admin$home$HomeView_methodInjection_0_g$] (com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment.java:116)
    at xng_g$ [as get_Key$type$com$mz$client$application$admin$home$HomeView$_annotation$$none$$_0_g$] (com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment.java:106)
    at ung_g$ [as get_Key$type$com$mz$client$application$admin$home$HomePresenter$MyView$_annotation$$none$$_0_g$] (com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment.java:30)
    at vng_g$ [as get_Key$type$com$mz$client$application$admin$home$HomePresenter$_annotation$$none$$_0_g$] (com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment.java:57)
    at Gng_g$ [as get_27_g$] (com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment.java:78)
    at Hng_g$ [as get_21_g$] (com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment.java:77)
    at I5f_g$ [as get_16_g$] (StandardProvider.java:47)
    at b7d_g$ [as getPresenter_0_g$] (ProxyImpl.java:44)
    at lag_g$ [as handleRequest_0_g$] (ProxyPlaceAbstract.java:263)
    at xag_g$ [as onPlaceRequest_0_g$] (ProxyPlaceAbstract.java:201)
    at L6d_g$ [as dispatch_54_g$] (PlaceRequestInternalEvent.java:130)
    at K6d_g$ [as dispatch_1_g$] (PlaceRequestInternalEvent.java:129)
    at W6b_g$ [as dispatch_0_g$] (GwtEvent.java:76)
    at Ngc_g$ (EventBus.java:40)
    at rhc_g$ [as doFire_0_g$] (SimpleEventBus.java:193)
    at yhc_g$ [as fireEventFromSource_0_g$] (SimpleEventBus.java:96)
    at x4d_g$ [as fireEvent_1_g$] (PlaceManagerImpl.java:158)
    at v4d_g$ [as doRevealPlace_0_g$] (PlaceManagerImpl.java:133)
    at R4d_g$ [as revealPlace_1_g$] (PlaceManagerImpl.java:354)
    at Q4d_g$ [as revealPlace_0_g$] (PlaceManagerImpl.java:335)
    at Jxg_g$ [as redirectToLoggedOnPage_0_g$] (LoginPresenter.java:169)
    at Mug_g$ [as loggedInAndInitialized_0_g$] (LoginPresenter.java:125)
    at Vug_g$ [as done_1_g$] (LoginPresenter.java:115)
    at Wce_g$ [as onChildRequestFailure_0_g$] (ParallelRequest.java:144)
    at Xce_g$ [as onChildRequestSuccess_0_g$] (ParallelRequest.java:120)
    at gde_g$ [as onSuccess_0_g$] (Request.java:68)
    at Lfd_g$ [as onResponseReceived_0_g$] (RequestCallbackAdapter.java:232)
    at pjc_g$ [as fireOnResponseReceived_0_g$] (Request.java:250)
    at xkc_g$ [as onReadyStateChange_0_g$] (RequestBuilder.java:412)
    at XMLHttpRequest.<anonymous> (XMLHttpRequest.java:329)
    at DI_g$ (Impl.java:233)
    at GI_g$ (Impl.java:285)
    at XMLHttpRequest.<anonymous> (Impl.java:71)

在我登录并显示如下所示的家后,现在正在发生:

private void revealAdminHomePlace() {
    this.placeManager.revealPlace(new PlaceRequest.Builder()
            .nameToken(AdminNameTokens.home)
            .build());
}

这是 HomeModule:

public class HomeModule extends AbstractPresenterModule {
    @Override
    protected void configure() {
        this.bindPresenter(HomePresenter.class, HomePresenter.MyView.class,
                HomeView.class, HomePresenter.MyProxy.class);
    }
}

HomePresenter

public class HomePresenter extends Presenter<HomePresenter.MyView, HomePresenter.MyProxy> {

    private final static Logger LOGGER = Logger.getLogger(HomePresenter.class.getName());

    public interface MyView extends View {
    }

    @ProxyStandard
    @NameToken(AdminNameTokens.home)
    public interface MyProxy extends ProxyPlace<HomePresenter> {
    }

    @Inject
    public HomePresenter(EventBus eventBus, MyView view, MyProxy proxy) {
        super(eventBus, view, proxy, AdminToolPresenter.SLOT_AdminToolMainContent);
    }

    @Override
    protected void onReveal() {
        LOGGER.fine("HomePresenter.onReveal()");
        super.onReveal();
    }
}

主页视图:

public class HomeView extends ViewImpl implements HomePresenter.MyView {

    public interface Binder extends UiBinder<Widget, HomeView> {
    }

    @Inject
    public HomeView(Binder uiBinder) {
        this.initWidget(uiBinder.createAndBindUi(this));
    }
}

以及 HomeView.ui.xml 文件:

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
    xmlns:g="urn:import:com.google.gwt.user.client.ui"
    xmlns:m="urn:import:gwt.material.design.client.ui"
    xmlns:m.addins="urn:import:gwt.material.design.addins.client.ui">
    <ui:style>

    </ui:style>
    <g:HTMLPanel>
        <m:MaterialLabel text="Welcome home!"/>
    </g:HTMLPanel>
</ui:UiBinder> 

我不知道这里出了什么问题,我似乎无法弄清楚问题所在。突然之间完全不知道这是什么..

我也 运行 进入了这个,结果我的浏览器仍然打开了 SuperDev 模式,我重新编译了整个项目。

关闭 SuperDev 模式,问题消失。

只需确保您已启用

<generateJsInteropExports>true</generateJsInteropExports>

使用 gwt-maven-plugin 时。

在我的例子中,这似乎是由于在小部件的 ui:style 中包含一些现代 CSS 引起的...不知道这是如何导致错误的,但我怀疑有问题的行是这样的: grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));。一旦我将这段样式放入普通 CSS 文件中,一切正常。

是的,这个错误是由 <ui:style> 元素引起的。
您可能只需要在 SuperDevMode 下通过单击“清除”按钮清除代码服务器的缓存。