clutz icon indicating copy to clipboard operation
clutz copied to clipboard

error: cannot find symbol import com.google.javascript.rhino.jstype.FunctionType.Parameter;

Open T-Skinner opened this issue 5 years ago • 6 comments
trafficstars

> Task :compileJava FAILED
/Users/ts76/Dev/clutz/src/main/java/com/google/javascript/clutz/DeclarationGenerator.java:45: error: cannot find symbol
import com.google.javascript.rhino.jstype.FunctionType.Parameter;

What could be causing this? I ran an npm install before the ./gradlew build

T-Skinner avatar Jun 16 '20 22:06 T-Skinner

You're probably running with an older version of Closure Compiler.

The FunctionType.Parameter API was added in https://github.com/google/closure-compiler/commit/041dc07d025b64fcf0239359bc732dd78c3d2e75 and is in the most recent release v20200614.

See https://github.com/angular/clutz#supported-versions.

Does updating your Closure Compiler version fix this?

lauraharker avatar Jun 24 '20 20:06 lauraharker

Created Google internal issue http://b/159832817.

lauraharker avatar Jun 24 '20 20:06 lauraharker

@lauraharker How do I update the closure dependency?

I went into build.gradle and switched the dependency reference to this: compile 'com.google.javascript:closure-compiler-unshaded:v20200614'

Now I have these new errors:

/Users/ts76/Dev/clutz2/src/main/java/com/google/javascript/gents/pass/comments/GeneralComment.java:39: error: cannot find symbol
    return new GeneralComment(comment.getCommentString(), comment.getStartPosition().getOffset());
                                                                 ^
  symbol:   method getStartPosition()
  location: variable comment of type NonJSDocComment

/Users/ts76/Dev/clutz2/src/main/java/com/google/javascript/gents/pass/comments/AstCommentLinkingPass.java:162: error: cannot find symbol
                      nonJSDocInfo.getStartPosition().getOffset())) {
                                  ^
  symbol:   method getStartPosition()
  location: variable nonJSDocInfo of type NonJSDocComment
/Users/ts76/Dev/clutz2/src/main/java/com/google/javascript/gents/pass/comments/AstCommentLinkingPass.java:166: error: cannot find symbol
                        nonJSDocInfo.getStartPosition().getOffset()));
                                    ^
  symbol:   method getStartPosition()
  location: variable nonJSDocInfo of type NonJSDocComment

T-Skinner avatar Jun 28 '20 21:06 T-Skinner

I tried updating to the latest SNAPSNOT build of Closure Compiler:

compile 'com.google.javascript:closure-compiler:1.0-SNAPSHOT'

and then I get just this error:

> Task :compileJava FAILED
clutz/src/main/java/com/google/javascript/clutz/DeclarationGenerator.java:1285: error: cannot find symbol
        .splitToStream(namespace)
        ^

and then I believe https://github.com/angular/clutz/issues/985#issuecomment-635911944 has a workaround for that.

Thanks for commenting on https://github.com/angular/clutz/issues/1006#issuecomment-650823513 BTW.

lauraharker avatar Jun 29 '20 19:06 lauraharker

@lauraharker I think I did get it to compile using the fix you mentioned but it does not pass the tests so it's useless right?

T-Skinner avatar Jun 29 '20 19:06 T-Skinner

Is this still an issue?

nreid260 avatar Sep 08 '20 20:09 nreid260