manolo / gwt-polymer-elements

Polymer Web Components for GWT. A collection of Material Design widgets for desktop and mobile.
Apache License 2.0
155 stars 49 forks source link

How to debug an existing GWT project after adding gwt-polymer-elements? #144

Closed DecimusMaximus closed 6 years ago

DecimusMaximus commented 7 years ago

Hello there!

I'm currently debugging an existing GWT 2.8 project using the GWT console. This means I can set breakpoints and watches in IntelliJ(the IDE I'm using) and it works. On-the fly compilation so I can see app modifications without recompiling the whole project also works. The problem is that this breaks down once I add polymer widgets, and I've been trying to understand what causes this for some time now.

This is the specific error that it throws: Caused by: com.google.gwt.dev.shell.HostedModeException: JSNI rewriter found reference to non-existent field in a field reference or java method tear-off: @java.util.ArrayList::array at com/vaadin/polymer/Polymer.java(575)

How do you guys debug a GWT application with polymer elements? Now I know that debugging in chrome works(kinda), it shows you the java code but I can only set breakpoints and can't add watches since all the variables have different names in the Javascript code.

Thank you in advance.

manolo commented 7 years ago

You cannot set breakpoints of external consumed JS in your java code. Use browser developer console and set breakpoints there.

amirtoole commented 7 years ago

If you enable source maps you should have no problems. I can access all my java source directly from within Chrome (can even make modifications that get saved to filesystem).

I use GWT.debugger(); to set a breakpoint in java code that is hit within Chrome.