-
1. Re: [4.0.0-SNAPSHOT] Is this Errai 4 or GWT 2.8 compiler issue?
hr.stoyanov Apr 14, 2016 7:17 PM (in response to hr.stoyanov).. not seen in the attached screenshots, but the second boolean argument is coming through fine. Also, moving the setVisible method into the HeaderMenu class, or inlining the method does not help. Here is the actual JS error:
Exception: com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property 'style' of undefined
I attached a new screenshot that shows that this might be an issue with the Errai generated proxy?
-
2. Re: [4.0.0-SNAPSHOT] Is this Errai 4 or GWT 2.8 compiler issue?
mbarkley Apr 15, 2016 10:55 AM (in response to hr.stoyanov)Hi Hristo,
From the last PNG it looks like the function call you are in has been invoked on the proxy and not the actual type, so the field that is passed in as the first parameter is undefined. I might be able to tell you more if I see the call stack. In particular, we want to find the first stack frame where a method on HeaderMenu is invoked. Is there a package private method you are using on this type? The container cannot proxy package private methods, so if you call a package private method from the outside of an @ApplicationScoped beans it will not be redirected to the actual instance and could cause a problem like this.
-
3. Re: [4.0.0-SNAPSHOT] Is this Errai 4 or GWT 2.8 compiler issue?
hr.stoyanov Apr 15, 2016 12:33 PM (in response to mbarkley)Max,
Indeed, the call chain starts from a package private method, and it did occur to me after reading your Errai4 migration notes in the docs!
Without knowing the reason for the resriction, I think there should be a better way to handle this - a runtime warning at a minimum. Mystery JS errors is not OK.
I also noticed that for Element injection you have to provide @Named("tag"). I saw that in the console log at runtime. Can this be made a compile time error? Also, I think I had a case when the annotation was missing and nobody complained, but I have to hunt down this case to show you ...
Thanks for your support, Errai 4 is shaping to be awesome!
-
4. Re: [4.0.0-SNAPSHOT] Is this Errai 4 or GWT 2.8 compiler issue?
mbarkley Apr 15, 2016 1:37 PM (in response to hr.stoyanov)Without knowing the reason for the resriction, I think there should be a better way to handle this - a runtime warning at a minimum. Mystery JS errors is not OK.
There are warnings about this in the build logs, but we can't fail the build for this because it would make it impossible to have @ApplicationScoped classes extending Widget.
I also noticed that for Element injection you have to provide @Named("tag"). I saw that in the console log at runtime.
I'm not sure what logging you're referring to. You don't always have to use the @Named to inject an element. That's only necessary if there is ambiguity (i.e. for elements that have multiple tags). As per the CDI spec @Named beans are also @Default, so if there is only one bean satisfying an element (like the @Named("a") Anchor) you do not need the @Named on the injection site. In cases where the @Named is necessary you should see rebind errors for ambiguous dependencies.
-
5. Re: [4.0.0-SNAPSHOT] Is this Errai 4 or GWT 2.8 compiler issue?
hr.stoyanov Apr 16, 2016 6:14 PM (in response to mbarkley)Max, OK I see about @Named, but here is what I observed:
1. I did not see any warning about the package private issue in any log (Chrome, superdev, compiler). Just JS error as seen in the screenshot.
2. I saw a warning for needed @Named annotation in the Chrome console.