Issue: Adding a ui:style after not having one in the UIBinder causes a crash.
To reproduce:
- Clone my demo repo:
git clone https://github.com/craigmit/GwtUiBinderStyleIssue.git
cd GwtUiBinderStyleIssue
- Start code server:
mvn gwt:codeserver -pl *-client -am
- Start server:
mvn spring-boot:run -pl *-server -am
- Visit page: http://localhost:8080/
- You should see a page saying "No style"
- Edit:
test-client/src/main/java/test/TestWidget.ui.xml
- Remove the comments, so it now looks like this:
- Refresh the page: http://localhost:8080/
The page crashes with:
Uncaught TypeError: this.get_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay_0_g$(...).style_3_g$ is not a function
at C3d_g$.F7d_g$ [as build_style_0_g$] (TestWidget_TestWidgetUiBinderImpl.java:72:1)
at new C3d_g$ (TestWidget_TestWidgetUiBinderImpl.java:43:1)
at w3d_g$.y3d_g$ [as createAndBindUi_1_g$] (TestWidget_TestWidgetUiBinderImpl.java:31:1)
at w3d_g$.x3d_g$ [as createAndBindUi_0_g$] (TestWidget_TestWidgetUiBinderImpl.java:28:1)
at new s3d_g$ (TestWidget.java:13:1)
at o3d_g$.p3d_g$ [as onModuleLoad_0_g$] (App.java:14:1)
at Array.J1b_g$ (test_00046App__EntryMethodHolder.java:3:1)
at initializeModules_0_g$ (ModuleUtils.java:44:1)
at Hp_g$ (Impl.java:293:1)
at Kp_g$ (Impl.java:352:1)
Even if you stop everything, mvn clean, and start it back up, it still crashes.
Workaround:
The only way I've found to get it to work is to remove the style so it looks like this:
Refresh the page. Now you see the page without the style:
Got style, ayyyy!
No style
Then add the style back in (so it looks like step 8 above), and it now works:

Issue: Adding a ui:style after not having one in the UIBinder causes a crash.
To reproduce:
git clone https://github.com/craigmit/GwtUiBinderStyleIssue.gitcd GwtUiBinderStyleIssuemvn gwt:codeserver -pl *-client -ammvn spring-boot:run -pl *-server -amtest-client/src/main/java/test/TestWidget.ui.xmlThe page crashes with:
Even if you stop everything, mvn clean, and start it back up, it still crashes.
Workaround:
The only way I've found to get it to work is to remove the style so it looks like this:
Refresh the page. Now you see the page without the style:
Then add the style back in (so it looks like step 8 above), and it now works: