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

profile :debug-repl not found #144

Open
koliyo opened this issue Jan 9, 2018 · 9 comments
Open

profile :debug-repl not found #144

koliyo opened this issue Jan 9, 2018 · 9 comments

Comments

@koliyo
Copy link

koliyo commented Jan 9, 2018

Environment

  • VSCode Version: 1.19.1
  • OS Version: macOS 10.13.1
  • Clojure Extension Version: 1.2.0

Description

Unable to start repl debugger. I tried using the example project here but was unable to get it running. I'm getting

Launch request
(Warning: profile :debug-repl not found.)
(Warning: profile :debug-repl not found.)

If I try and run lein with-profile +debug-repl repl from the command line I instead get

$ lein with-profile +debug-repl repl 
Error encountered performing task 'repl' with profile(s): 'base,system,user,provided,dev,dev,debug-repl'
java.lang.NullPointerException
	at leiningen.core.project$absolutize.invokeStatic(project.clj:448)
	at leiningen.core.project$absolutize.invoke(project.clj:447)
	at clojure.core$partial$fn__4759.invoke(core.clj:2515)
	at clojure.core$map$fn__4785.invoke(core.clj:2644)
	at clojure.lang.LazySeq.sval(LazySeq.java:40)
	at clojure.lang.LazySeq.seq(LazySeq.java:49)
	at clojure.lang.LazySeq.withMeta(LazySeq.java:34)
	at clojure.lang.LazySeq.withMeta(LazySeq.java:17)
	at clojure.core$with_meta__4375.invokeStatic(core.clj:218)
	at clojure.core$with_meta__4375.invoke(core.clj:217)
	at leiningen.core.project$with_meta_STAR_.invokeStatic(project.clj:122)
	at leiningen.core.project$with_meta_STAR_.invoke(project.clj:117)
	at leiningen.core.project$absolutize_path$fn__3408.invoke(project.clj:457)
	at clojure.core$update.invokeStatic(core.clj:5960)
	at clojure.core$update.invoke(core.clj:5952)
	at leiningen.core.project$absolutize_path.invokeStatic(project.clj:457)
	at leiningen.core.project$absolutize_path.invoke(project.clj:452)
	at clojure.core.protocols$iter_reduce.invokeStatic(protocols.clj:49)
	at clojure.core.protocols$fn__6744.invokeStatic(protocols.clj:75)
	at clojure.core.protocols$fn__6744.invoke(protocols.clj:75)
	at clojure.core.protocols$fn__6684$G__6679__6697.invoke(protocols.clj:13)
	at clojure.core$reduce.invokeStatic(core.clj:6545)
	at clojure.core$reduce.invoke(core.clj:6527)
	at leiningen.core.project$absolutize_paths.invokeStatic(project.clj:463)
	at leiningen.core.project$absolutize_paths.invoke(project.clj:462)
	at leiningen.core.project$init_profiles.invokeStatic(project.clj:887)
	at leiningen.core.project$init_profiles.doInvoke(project.clj:865)
	at clojure.lang.RestFn.invoke(RestFn.java:442)
	at leiningen.core.project$set_profiles.invokeStatic(project.clj:911)
	at leiningen.core.project$set_profiles.doInvoke(project.clj:906)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at leiningen.with_profile$with_profiles_STAR_.invokeStatic(with_profile.clj:12)
	at leiningen.with_profile$with_profiles_STAR_.invoke(with_profile.clj:8)
	at leiningen.with_profile$apply_task_with_profiles.invokeStatic(with_profile.clj:53)
	at leiningen.with_profile$apply_task_with_profiles.invoke(with_profile.clj:45)
	at leiningen.with_profile$with_profile$fn__9172.invoke(with_profile.clj:85)
	at clojure.core$mapv$fn__6953.invoke(core.clj:6627)
	at clojure.core.protocols$fn__6755.invokeStatic(protocols.clj:167)
	at clojure.core.protocols$fn__6755.invoke(protocols.clj:124)
	at clojure.core.protocols$fn__6710$G__6705__6719.invoke(protocols.clj:19)
	at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
	at clojure.core.protocols$fn__6738.invokeStatic(protocols.clj:75)
	at clojure.core.protocols$fn__6738.invoke(protocols.clj:75)
	at clojure.core.protocols$fn__6684$G__6679__6697.invoke(protocols.clj:13)
	at clojure.core$reduce.invokeStatic(core.clj:6545)
	at clojure.core$mapv.invokeStatic(core.clj:6618)
	at clojure.core$mapv.invoke(core.clj:6618)
	at leiningen.with_profile$with_profile.invokeStatic(with_profile.clj:85)
	at leiningen.with_profile$with_profile.doInvoke(with_profile.clj:63)
	at clojure.lang.RestFn.invoke(RestFn.java:445)
	at clojure.lang.Var.invoke(Var.java:388)
	at clojure.lang.AFn.applyToHelper(AFn.java:160)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.core$apply.invokeStatic(core.clj:648)
	at clojure.core$apply.invoke(core.clj:641)
	at leiningen.core.main$partial_task$fn__4667.doInvoke(main.clj:284)
	at clojure.lang.RestFn.applyTo(RestFn.java:139)
	at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:648)
	at clojure.core$apply.invoke(core.clj:641)
	at leiningen.core.main$apply_task.invokeStatic(main.clj:334)
	at leiningen.core.main$apply_task.invoke(main.clj:320)
	at lein_cprop.plugin$write_env_to_file.invokeStatic(plugin.clj:27)
	at lein_cprop.plugin$write_env_to_file.invoke(plugin.clj:25)
	at clojure.lang.Var.invoke(Var.java:394)
	at clojure.lang.AFn.applyToHelper(AFn.java:165)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.core$apply.invokeStatic(core.clj:648)
	at clojure.core$apply.invoke(core.clj:641)
	at robert.hooke$compose_hooks$fn__9113.doInvoke(hooke.clj:40)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:646)
	at clojure.core$apply.invoke(core.clj:641)
	at robert.hooke$run_hooks.invokeStatic(hooke.clj:46)
	at robert.hooke$run_hooks.invoke(hooke.clj:45)
	at robert.hooke$prepare_for_hooks$fn__9118$fn__9119.doInvoke(hooke.clj:54)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
	at clojure.lang.RestFn.invoke(RestFn.java:436)
	at leiningen.core.main$resolve_and_apply.invokeStatic(main.clj:340)
	at leiningen.core.main$resolve_and_apply.invoke(main.clj:336)
	at leiningen.core.main$_main$fn__4734.invoke(main.clj:420)
	at leiningen.core.main$_main.invokeStatic(main.clj:411)
	at leiningen.core.main$_main.doInvoke(main.clj:408)
	at clojure.lang.RestFn.invoke(RestFn.java:436)
	at clojure.lang.Var.invoke(Var.java:388)
	at clojure.lang.AFn.applyToHelper(AFn.java:160)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.core$apply.invokeStatic(core.clj:646)
	at clojure.main$main_opt.invokeStatic(main.clj:314)
	at clojure.main$main_opt.invoke(main.clj:310)
	at clojure.main$main.invokeStatic(main.clj:421)
	at clojure.main$main.doInvoke(main.clj:384)
	at clojure.lang.RestFn.invoke(RestFn.java:482)
	at clojure.lang.Var.invoke(Var.java:401)
	at clojure.lang.AFn.applyToHelper(AFn.java:171)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.main.main(main.java:37)

Any clue what is going on?

Steps to Reproduce

See indiejames/clojure-code-demo#2

@jonlaing
Copy link

I got literally the exact same thing... not much to go on unfortunately...

@gaborveres-planorama
Copy link

Same issue here, no clue about what's going on

@gaborveres-planorama
Copy link

As for the NullPointerException (manual start), you can get rid of it by hard coding the two values that should come from env vars in profiles.clj, such as:
{:debug-repl {:resource-paths ["/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/lib/tools.jar"] :repl-options {:nrepl-middleware [debug-middleware.core/debug-middleware]} :dependencies [[org.clojure/clojure "1.8.0"] [debug-middleware "0.4.5"] [javax.servlet/servlet-api "2.5"] [ring/ring-mock "0.3.0"]] :source-paths ["src" "dev" "test"]}}

With this, the repl can be started manually.
The issue with starting from VS Code through the launch config is that the command is started from the root directory ( / ), not from the workspace root, thus lein can not find profiles.clj . Next step is to figure out:

  • Why the env vars are not working as expected
  • Why the repl process is launched from the wrong directory

@gaborveres-planorama
Copy link

If you explicitly set the working directory in the launch config (see the line with cwd below), the repl launches fine, but the debugger doesn't seem to connect.
{ "version": "0.2.0", "configurations": [ { "commandLine": [ "/usr/local/bin/lein", "with-profile", "+debug-repl", "repl", ":start", ":port", "5555" ], "name": "Clojure-Debug", "cwd": "${workspaceRoot}", "type": "clojure", "request": "launch", "env": {} }, { "commandLine": [ "/usr/local/bin/lein", "with-profile", "+debug-repl", "repl", ":start", ":port", "5555" ], "debug": false, "name": "Clojure-REPL", "type": "clojure", "request": "launch", "env": {} } ] }

@aquaraga
Copy link

I'm also getting the same error.
Hate to say this - but I'm switching to LightTable for now, and will get back if anyone comes up with a solution for this.

@gaborveres-planorama
Copy link

I ended up with Atom + ProtoRepl and am very happy with it - see https://git.io/atom_clojure_setup

@krishnarohitreddy
Copy link

krishnarohitreddy commented Aug 9, 2018

me too same issue, did any find the solution here?

@jfriestedt
Copy link

Also encountering this issue.

@minkir014
Copy link

See this tutorial about this extension. This will help you solve these issues.

https://youtu.be/73PnuVBkXxU

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

No branches or pull requests

7 participants