Skip to content
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

NPE when :infer-externs true and CLJS 1.9.908 #172

Closed
kanwei opened this issue Sep 3, 2017 · 11 comments
Closed

NPE when :infer-externs true and CLJS 1.9.908 #172

kanwei opened this issue Sep 3, 2017 · 11 comments
Labels

Comments

@kanwei
Copy link

kanwei commented Sep 3, 2017

Seems like 1.9.908 broke the :infer-externs flag, and causes an NPE when compiling. Anyone else having this issue?

@esp1
Copy link

esp1 commented Sep 5, 2017

I have this issue too.

@Deraen
Copy link
Contributor

Deraen commented Sep 5, 2017

I reproduced this today, I'll try to look into what's the problem tomorrow.

@Deraen Deraen added the bug label Sep 5, 2017
@kanwei
Copy link
Author

kanwei commented Sep 5, 2017

It seems like a change in the Google Closure Compiler dependency from ClojureScript core caused this to happen. I've filed a JIRA ticket in CLJS as well.

@Deraen
Copy link
Contributor

Deraen commented Sep 8, 2017

Have you tested this without Boot-cljs? I'm unable to reproduce this with only Cljs compiler: https://clojurescript.org/guides/quick-start

@danielsz
Copy link
Contributor

danielsz commented Sep 8, 2017

I also get a NPE in advanced mode with boot-cljs 2.1.3 and Clojurescript 1.9.908.
My compiler options:

:compiler-options {:asset-path "/js/teamsocial.out"
                    :parallel-build true
                    :infer-externs true}

With boot-cljs 2.1.4-SNAPSHOT, I have a couple of warnings, but compilation succeeds.

@Deraen
Copy link
Contributor

Deraen commented Sep 8, 2017

Huh? NPE was fixed by changes in master? What the...

@danielsz
Copy link
Contributor

danielsz commented Sep 8, 2017

That's what I see, yes. NPE with 2.1.3, compilation passes with 2.1.4-SNAPSHOT.
I have no idea what's going on, so I'll dump the warnings I see in case this is useful.

Sep 08, 2017 3:45:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /home/arch/daniel/.boot/cache/tmp/home/arch/daniel/Clojure/teamsocial/ae0/-yhf6r6/js/teamsocial.out/inferred_externs.js:24: WARNING - name goog is not defined in the externs.
goog.isArrayLike;
^^^^

Sep 08, 2017 3:45:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /home/arch/daniel/.boot/cache/tmp/home/arch/daniel/Clojure/teamsocial/ae0/-yhf6r6/js/teamsocial.out/inferred_externs.js:25: WARNING - name goog is not defined in the externs.
goog.string;
^^^^

Sep 08, 2017 3:45:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /home/arch/daniel/.boot/cache/tmp/home/arch/daniel/Clojure/teamsocial/ae0/-yhf6r6/js/teamsocial.out/inferred_externs.js:26: WARNING - name goog is not defined in the externs.
goog.string.StringBuffer;
^^^^

Sep 08, 2017 3:45:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /home/arch/daniel/.boot/cache/tmp/home/arch/daniel/Clojure/teamsocial/ae0/-yhf6r6/js/teamsocial.out/inferred_externs.js:27: WARNING - name goog is not defined in the externs.
goog.string.StringBuffer.prototype.append;
^^^^

Sep 08, 2017 3:45:32 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 0 error(s), 4 warning(s)

@kanwei
Copy link
Author

kanwei commented Sep 11, 2017

I'm getting errors instead of just warnings when on 2.1.4-SNAPSHOT and infer-externs true:

Compiling ClojureScript...
• public/js/ddplugin.js
• public/js/ddregister.js
• public/js/mp360.js
Sep 11, 2017 12:41:43 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/kanwei/.boot/cache/tmp/Users/kanwei/Projects/doublethedonation/1aa/-fwuuwu/public/js/ddplugin.out/cljs/core.js:3579: ERROR - Parse error. primary expression expected
case ##Inf:
      ^

Sep 11, 2017 12:41:43 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 1 error(s), 0 warning(s)
ERROR: JSC_PARSE_ERROR. Parse error. primary expression expected at /Users/kanwei/.boot/cache/tmp/Users/kanwei/Projects/doublethedonation/1aa/-fwuuwu/public/js/ddplugin.out/cljs/core.js line 3579 : 6
Sep 11, 2017 12:41:43 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/kanwei/.boot/cache/tmp/Users/kanwei/Projects/doublethedonation/1aa/-ionqhb/public/js/ddregister.out/cljs/core.js:3579: ERROR - Parse error. primary expression expected
case ##Inf:
      ^

Sep 11, 2017 12:41:43 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 1 error(s), 0 warning(s)
ERROR: JSC_PARSE_ERROR. Parse error. primary expression expected at /Users/kanwei/.boot/cache/tmp/Users/kanwei/Projects/doublethedonation/1aa/-ionqhb/public/js/ddregister.out/cljs/core.js line 3579 : 6
Sep 11, 2017 12:41:44 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/kanwei/.boot/cache/tmp/Users/kanwei/Projects/doublethedonation/1aa/sz4rmy/public/js/mp360.out/cljs/core.js:3579: ERROR - Parse error. primary expression expected
case ##Inf:
      ^

Sep 11, 2017 12:41:44 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 1 error(s), 0 warning(s)
ERROR: JSC_PARSE_ERROR. Parse error. primary expression expected at /Users/kanwei/.boot/cache/tmp/Users/kanwei/Projects/doublethedonation/1aa/sz4rmy/public/js/mp360.out/cljs/core.js line 3579 : 6

@Deraen
Copy link
Contributor

Deraen commented Sep 11, 2017

@kanwei Those errors (##Inf) are not related to infer-externs: Cljs is broken with latest Clojure alpha: https://dev.clojure.org/jira/browse/CLJS-2352

@kanwei
Copy link
Author

kanwei commented Sep 11, 2017

Got it. So I switched back to alpha19, and now it does compile successfully with warnings, like danielsz's log:

Sep 11, 2017 12:48:53 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/kanwei/.boot/cache/tmp/Users/kanwei/Projects/doublethedonation/1is/98uoye/public/js/mp360.out/inferred_externs.js:41: WARNING - name goog is not defined in the externs.
goog.isArrayLike;
^^^^

Sep 11, 2017 12:48:53 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/kanwei/.boot/cache/tmp/Users/kanwei/Projects/doublethedonation/1is/98uoye/public/js/mp360.out/inferred_externs.js:42: WARNING - name goog is not defined in the externs.
goog.net;
^^^^

Sep 11, 2017 12:48:53 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/kanwei/.boot/cache/tmp/Users/kanwei/Projects/doublethedonation/1is/98uoye/public/js/mp360.out/inferred_externs.js:43: WARNING - name goog is not defined in the externs.
goog.net.XhrIo;
^^^^

Sep 11, 2017 12:48:53 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 0 error(s), 4 warning(s)

@Deraen
Copy link
Contributor

Deraen commented Sep 25, 2017

2.1.4 is released, seems to work.

@Deraen Deraen closed this as completed Sep 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants