New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught TypeError: InternalJsUtil.m_getLength__jsinterop_base_JsArrayLike is not a function #73
Comments
Oh, PS, you only need compile |
OK.. so I know the issue. Yay... and it is not in the plugin nor any replaced dependency. The issue is that my shaded JAR included the I submitted a PR #74 showing it works OK. I obviously leave it to you as to whether you choose to merge. |
Closing.. However the mucky workaround of making a shaded JAR with some only limited dependencies flattened sure smells bad. ... IMO, and I say it again, if Maven's dependency exclusions were supported none of this would be needed. |
Shading jsinterop-base is the problem here, and shading it. Google deliberately (for reasons I do not understand) will only make a jsinterop-base jar in maven compatible with gwt2, and will not make it work with j2cl. We had to hack in some "detect specific known broken dependencies that the ecosystem is stuck with" into the plugin, in the form of "dependency replacements", but this would be very difficult to modify to somehow handle any possible shaded configuration. We would need to a) somehow detect that it was shaded, to any possible package, and b) look for any past/present/future release of jsinterop-base and recognize that the code is bad and remove it. The "real" solution is to give up on jsinterop-base, or to convince the maintainers to rewrite it so that it is compatible with both at the same time. Note that you won't have this problem in bazel, since they require bazel consumers to depend on a version of the code that is modified by a script before it is imported: In theory that could be a different solution, encourage a "standardized" format like I'm sorry that there isn't a more satisfactory answer than this. |
Hello @niloc132 sorry, but looking for advice again.
So, given the following:
[Generated a shaded JAR containing a POJO model and deserialization code]
[J2CL compilation and webapp to test]
It all compiles OK now but there is a runtime issue I do not understand:
The code
InternalJsUtil.m_getLength__jsinterop_base_JsArrayLike
is indeed not a function.It is commented out in the J2CL input:-
Here's the (Closure compiler input?)
.impl.java.js
files:-impl.java.js files.zip
There's a "nice" getter method with a different name in the J2CL input for
InternalJsUtil.impl.java.js
but clearly something somewhere wants to use the commented out native method (assuming the comment is really a comment and there's not some wizardry going on I do not understand).Do you know what's going on?
The text was updated successfully, but these errors were encountered: