clojure-emacs / cider-nrepl

A collection of nREPL middleware to enhance Clojure editors with common functionality like definition lookup, code completion, etc.
https://docs.cider.mx/cider-nrepl
672 stars 175 forks source link

WARNING: CIDER requires cider-nrepl to be fully fuctional. Many things will not work without it! #597

Closed xistory closed 5 years ago

xistory commented 5 years ago

Use the template below when reporting bugs. Please, make sure that you're running the latest stable release or the latest snapshot of cider-nrepl and that the problem you're reporting hasn't been reported (and potentially fixed) already.

Expected behavior

cider-nrepl is well added to my project so I can use <M-.>key to jump to the source code.

Actual behavior

I get this warning messages when I run M-x cider-connect localhost 7002:

WARNING: CIDER requires cider-nrepl to be fully fuctional. Many things will not work without it!
More information.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0 (package: 20180826.2149) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.

Steps to reproduce the problem

First to create project: lein new luminus myapp +re-frame +postgres (you might use other DB to easily migrate) and then database migration should be done. after that: lein run lein figwheel

then in emacs: M-x cider-connect localhost 7002

now I got this warning messages described above in repl.

Environment & Version information

here is my project.clj file:

(defproject frame "0.1.0-SNAPSHOT"

  :description "FIXME: write description"
  :url "http://example.com/FIXME"

  :dependencies [[baking-soda "0.2.0" :exclusions [cljsjs/react-bootstrap]]
                 [cheshire "5.8.1"]
                 [clj-commons/secretary "1.2.4"]
                 [cljs-ajax "0.8.0"]
                 [cljsjs/react-popper "0.10.4-0"]
                 [cljsjs/react-transition-group "2.4.0-0"]
                 [clojure.java-time "0.3.2"]
                 [com.cognitect/transit-clj "0.8.313"]
                 [compojure "1.6.1"]
                 [conman "0.8.3"]
                 [cprop "0.1.13"]
                 [day8.re-frame/http-fx "0.1.6"]
                 [funcool/struct "1.3.0"]
                 [luminus-immutant "0.2.5"]
                 [luminus-migrations "0.6.3"]
                 [luminus-transit "0.1.1"]
                 [luminus/ring-ttl-session "0.3.2"]
                 [markdown-clj "1.0.5"]
                 [metosin/muuntaja "0.6.3"]
                 [metosin/ring-http-response "0.9.1"]
                 [mount "0.1.15"]
                 [nrepl "0.5.3"]
                 [org.clojure/clojure "1.10.0"]
                 [org.clojure/clojurescript "1.10.439" :scope "provided"]
                 [org.clojure/tools.cli "0.4.1"]
                 [org.clojure/tools.logging "0.4.1"]
                 [org.postgresql/postgresql "42.2.5"]
                 [org.webjars.bower/tether "1.4.4"]
                 [org.webjars/bootstrap "4.2.1"]
                 [org.webjars/font-awesome "5.6.1"]
                 [org.webjars/webjars-locator "0.34"]
                 [re-frame "0.10.6"]
                 [reagent "0.8.1"]
                 [ring-webjars "0.2.0"]
                 [ring/ring-core "1.7.1"]
                 [ring/ring-defaults "0.3.2"]
                 [selmer "1.12.5"]
                 [bouncer "1.0.0"]
                 ;[cider/cider-nrepl "0.20.0"]
                 ]

  :min-lein-version "2.0.0"

  :source-paths ["src/clj" "src/cljs" "src/cljc"]
  :test-paths ["test/clj"]
  :resource-paths ["resources" "target/cljsbuild"]
  :target-path "target/%s/"
  :main ^:skip-aot frame.core

  :plugins [[lein-cljsbuild "1.1.7"]
            [lein-immutant "2.1.0"]
            ]
  :clean-targets ^{:protect false}
  [:target-path [:cljsbuild :builds :app :compiler :output-dir] [:cljsbuild :builds :app :compiler :output-to]]
  :figwheel
  {:http-server-root "public"
   :server-logfile "log/figwheel-logfile.log"
   :nrepl-port 7002
   :css-dirs ["resources/public/css"]
   :nrepl-middleware [cider.piggieback/wrap-cljs-repl]}

  :profiles
  {:uberjar {:omit-source true
             :prep-tasks ["compile" ["cljsbuild" "once" "min"]]
             :cljsbuild
             {:builds
              {:min
               {:source-paths ["src/cljc" "src/cljs" "env/prod/cljs"]
                :compiler
                {:output-dir "target/cljsbuild/public/js"
                 :output-to "target/cljsbuild/public/js/app.js"
                 :source-map "target/cljsbuild/public/js/app.js.map"
                 :optimizations :advanced
                 :pretty-print false
                 :infer-externs true
                 :closure-warnings
                 {:externs-validation :off :non-standard-jsdoc :off}
                 :externs ["react/externs/react.js"]}}}}

             :aot :all
             :uberjar-name "frame.jar"
             :source-paths ["env/prod/clj"]
             :resource-paths ["env/prod/resources"]}

   :dev           [:project/dev :profiles/dev]
   :test          [:project/dev :project/test :profiles/test]

   :project/dev  {:jvm-opts ["-Dconf=dev-config.edn"]
                  :dependencies [[binaryage/devtools "0.9.10"]
                                 [cider/piggieback "0.3.10"]
                                 [doo "0.1.11"]
                                 [expound "0.7.2"]
                                 [figwheel-sidecar "0.5.18"]
                                 [pjstadig/humane-test-output "0.9.0"]
                                 [prone "1.6.1"]
                                 [re-frisk "0.5.4"]
                                 [ring/ring-devel "1.7.1"]
                                 [ring/ring-mock "0.3.2"]]
                  :plugins      [[com.jakemccrary/lein-test-refresh "0.23.0"]
                                 [lein-doo "0.1.11"]
                                 [lein-figwheel "0.5.18"]
                                 ]
                  :cljsbuild
                  {:builds
                   {:app
                    {:source-paths ["src/cljs" "src/cljc" "env/dev/cljs"]
                     :figwheel {:on-jsload "frame.core/mount-components"}
                     :compiler
                     {:main "frame.app"
                      :asset-path "/js/out"
                      :output-to "target/cljsbuild/public/js/app.js"
                      :output-dir "target/cljsbuild/public/js/out"
                      :source-map true
                      :optimizations :none
                      :pretty-print true
                      :closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}
                      :preloads [re-frisk.preload]}}}}

                  :doo {:build "test"}
                  :source-paths ["env/dev/clj"]
                  :resource-paths ["env/dev/resources"]
                  :repl-options {:init-ns user}
                  :injections [(require 'pjstadig.humane-test-output)
                               (pjstadig.humane-test-output/activate!)]}
   :project/test {:jvm-opts ["-Dconf=test-config.edn"]
                  :resource-paths ["env/test/resources"]
                  :cljsbuild
                  {:builds
                   {:test
                    {:source-paths ["src/cljc" "src/cljs" "test/cljs"]
                     :compiler
                     {:output-to "target/test.js"
                      :main "frame.doo-runner"
                      :optimizations :whitespace
                      :pretty-print true}}}}

                  }
   :profiles/dev {}
:profiles/test {}})

and here is my profiles.clj file located ~/.lein/

{:repl {:plugins [[refactor-nrepl "2.4.0"]
                       [cider/cider-nrepl "0.20.0"]]}}

cider-nrepl version

0.20.0 to match with cider version because I use cider 0.20.0 which is Melpa-stable version.

Java version

openjdk version 1.8

Operating system

Lubuntu linux

dpsutton commented 5 years ago

I'm on CIDER 0.21.0-snapshot and I'm doing: lein new luminus myapp +re-frame +postgres and then m-x cider-jack-in-clj&cljs and things seem to work out for me.

~I'm not sure how to actually get the web server up and running but I'm not getting any nrepl errors on the repl.~

I need to hit port 3000 for the app, not 3449 which is the fig wheel port

I know this doesn't seem to help you in your current situation but the good news is that the bug seems to be fixed.

Frozenlock commented 5 years ago

The problem is with your nrepl dependency. [nrepl "0.5.3"] should be [nrepl "0.6.0"] or higher.

bbatsov commented 5 years ago

I guess we can close this.

pdenno commented 5 years ago

I don't know whether updating the nrepl dependency fixed the OP's problem, but I tried this luminus example with [nrepl "0.6.0"] and got the same CIDER requires cider-nrepl to be fully functional....

The solution for me was m-x cider-jack-in-clj&cljs as dpsutton suggests above. If you m-x cider-connect, you get the message.

fdhenard commented 3 years ago

I'm getting this warning, and I don't have any nrepl dependencies. Any ideas?

bbatsov commented 3 years ago

@fdhenard How are you starting CIDER?

fdhenard commented 3 years ago

Yes, I should have mentioned that. I'm using cider-connect to connect to a shadow-cljs nrepl port.

On Thu, Sep 24, 2020, 12:58 AM Bozhidar Batsov notifications@github.com wrote:

@fdhenard https://github.com/fdhenard How are you starting CIDER?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/clojure-emacs/cider-nrepl/issues/597#issuecomment-698130755, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGYB3EPHJEB4KXENJ53LZLSHLNYFANCNFSM4GXVLXRA .

bbatsov commented 3 years ago

I'm guessing you didn't add cider-nrepl to your project deps, as that'd be the most logical explanation.

fdhenard commented 3 years ago

Ah, I guess I thought that we didn't need to add that dependency to our projects anymore because we don't get that warning with the Clojure repl. Sorry if that's spelled out in the documentation and I neglected to look for it! Thanks for your help, and I love Cider!

bbatsov commented 3 years ago

cider-nrepl is automatically added to the deps when doing cider-jack-in, but when using cider-connect you need to add it yourselves.

fdhenard commented 3 years ago

I see, thanks!