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

Shadow-cljs REPL causes cider complete errors NullPointerException #14

Closed
jaidetree opened this issue Apr 28, 2020 · 3 comments · Fixed by #27
Closed

Shadow-cljs REPL causes cider complete errors NullPointerException #14

jaidetree opened this issue Apr 28, 2020 · 3 comments · Fixed by #27

Comments

@jaidetree
Copy link

jaidetree commented Apr 28, 2020

Reproduction

  1. Install cider-nrepl 0.25.0-alpha1
  2. Start a shadow nrepl server and run a cljs build file to initialize the cljs repl
  3. Connect to the Cljs repl via cider
  4. Begin typing

Expected

  • A list of completions as I type
  • No cider error messages raised

Actual

  • A complete error is raised and will keep being raised everytime I type until I click suppress cider complete errors
  • Error seen in screenshot attached below

image

Stack Trace

1. Unhandled java.lang.NullPointerException
   (No message)

    complete_for_nrepl.clj:  119  cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/node-env?
    complete_for_nrepl.clj:  106  cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/node-env?
    complete_for_nrepl.clj:  126  cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/ensure-suitable-cljs-is-loaded/fn
                  AFn.java:  152  clojure.lang.AFn/applyToHelper
                  AFn.java:  144  clojure.lang.AFn/applyTo
                  core.clj:  665  clojure.core/apply
                  core.clj: 1973  clojure.core/with-bindings*
                  core.clj: 1973  clojure.core/with-bindings*
               RestFn.java:  425  clojure.lang.RestFn/invoke
    complete_for_nrepl.clj:  123  cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/ensure-suitable-cljs-is-loaded
    complete_for_nrepl.clj:  121  cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/ensure-suitable-cljs-is-loaded
    complete_for_nrepl.clj:  181  cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/handle-completion-msg!
    complete_for_nrepl.clj:  164  cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/handle-completion-msg!
    complete_for_nrepl.clj:  202  cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/complete-for-default-cljs-env
    complete_for_nrepl.clj:  195  cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/complete-for-default-cljs-env
    complete_for_nrepl.clj:  232  cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/complete-for-nrepl
    complete_for_nrepl.clj:  227  cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/complete-for-nrepl
              complete.clj:   40  cider.nrepl.middleware.complete/complete
              complete.clj:   30  cider.nrepl.middleware.complete/complete
              complete.clj:   54  cider.nrepl.middleware.complete/complete-reply
              complete.clj:   53  cider.nrepl.middleware.complete/complete-reply
        error_handling.clj:  160  cider.nrepl.middleware.util.error-handling/eval25503/fn
              MultiFn.java:  234  clojure.lang.MultiFn/invoke
              complete.clj:   66  cider.nrepl.middleware.complete/handle-complete
              complete.clj:   65  cider.nrepl.middleware.complete/handle-complete
                  Var.java:  388  clojure.lang.Var/invoke
                 nrepl.clj:  132  cider.nrepl/wrap-complete/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  396  cider.nrepl/wrap-spec/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
             load_file.clj:   81  nrepl.middleware.load-file/wrap-load-file/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                caught.clj:   97  nrepl.middleware.caught/wrap-caught/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
               nrepl04.clj:  232  shadow.cljs.devtools.server.nrepl04/cljs-load-file/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
     fake_piggieback04.clj:   54  cider.piggieback/wrap-cljs-repl/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:   98  cider.nrepl/wrap-content-type/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  462  cider.nrepl/wrap-tracker/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
     fake_piggieback04.clj:   31  cemerick.piggieback/wrap-cljs-repl/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
               nrepl04.clj:  193  shadow.cljs.devtools.server.nrepl04/cljs-select/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  278  cider.nrepl/wrap-ns/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
               session.clj:  272  nrepl.middleware.session/session/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  506  cider.nrepl/wrap-clojuredocs/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  182  cider.nrepl/wrap-format/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 print.clj:  234  nrepl.middleware.print/wrap-print/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
               nrepl04.clj:  359  shadow.cljs.devtools.server.nrepl04/start/fn
                server.clj:   18  nrepl.server/handle*
                server.clj:   15  nrepl.server/handle*
                server.clj:   27  nrepl.server/handle/fn
                  core.clj: 2030  clojure.core/binding-conveyor-fn/fn
                  AFn.java:   18  clojure.lang.AFn/call
           FutureTask.java:  266  java.util.concurrent.FutureTask/run
   ThreadPoolExecutor.java: 1149  java.util.concurrent.ThreadPoolExecutor/runWorker
   ThreadPoolExecutor.java:  624  java.util.concurrent.ThreadPoolExecutor$Worker/run
               Thread.java:  748  java.lang.Thread/run

Notes

@jaidetree jaidetree changed the title Shadow-cljs REPL causes cider complete errors Shadow-cljs REPL causes cider complete errors NullPointerException Apr 28, 2020
vemv added a commit that referenced this issue Sep 13, 2021
Makes it nil-safe, while taking care of not comparing nil to nil.

It also fixes edge cases making it work as intended over various auto-generated classes.

Fixes #14
@vemv vemv mentioned this issue Sep 13, 2021
vemv added a commit that referenced this issue Sep 13, 2021
Makes it nil-safe, while taking care of not comparing nil to nil.

It also fixes edge cases making it work as intended over various auto-generated classes.

Fixes #14
@vemv vemv closed this as completed in #27 Sep 13, 2021
@vemv
Copy link
Member

vemv commented Sep 13, 2021

Released [org.rksm/suitable "0.4.1-alpha1"], feel free to try it out

@vemv
Copy link
Member

vemv commented Sep 13, 2021

Whoops, sorry, it's not as easy as bumping that dep isolatedly. We have to cut a cider-nrepl release that uses the new suitable.

@vemv
Copy link
Member

vemv commented Oct 2, 2021

Fix finally available in cider-20211002.1153.tar (i.e. today's CIDER snapshot published on MELPA) or via [org.rksm/suitable "0.4.1"] for other setups

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants