Closed KUR-creative closed 3 years ago
I can't reproduce this problem. It could be due to some plugins you have configured on your machine maybe?
Feel free to reopen this if you can come up with a repro case that doesn't involve any 3rd-party code.
Same error: Syntax error compiling at (/private/var/folders/4x/kcnw7mpn7cscc84llq9rz5gr0000gn/T/form-init5070701951296281096.clj:4353:33). Unable to resolve symbol: create in this context
Leiningen version: Leiningen 2.9.6 on Java 16.0.2 OpenJDK 64-Bit Server VM Happens when I try to open a REPL with this dependencies in project.clj: [org.clojure/clojure "1.10.1"] [com.walmartlabs/lacinia "0.38.0"]]
Just had the same issue with a project.clj
like
(defproject tove "0.1.0"
:dependencies [[org.clojure/clojure "1.10.3"]] ; The language itself.
:main ^:skip-aot tove.core ; In order to prevent staticization of dynamic things like environment variable lookup.
)
and a single source file src/tove/core.clj
like
(ns tove.main)
(defn -main [] "Hello world!")
The problem in my case was with the namespace declared at the top of that file. If I change it to tove.core
lein repl
will work just as expected. With the namespace being tove.main
I get the following error.
Syntax error compiling at (/tmp/form-init6924841063651840338.clj:4341:33).
Unable to resolve symbol: create in this context
Full report at:
/tmp/clojure-15744339133944682647.edn
Subprocess failed
and the full report reading
{:clojure.main/message
"Syntax error compiling at (/tmp/form-init6924841063651840338.clj:4341:33).\nUnable to resolve symbol: create in this context\n",
:clojure.main/triage
{:clojure.error/phase :compile-syntax-check,
:clojure.error/line 4341,
:clojure.error/column 33,
:clojure.error/source "form-init6924841063651840338.clj",
:clojure.error/path "/tmp/form-init6924841063651840338.clj",
:clojure.error/class java.lang.RuntimeException,
:clojure.error/cause
"Unable to resolve symbol: create in this context"},
:clojure.main/trace
{:via
[{:type clojure.lang.Compiler$CompilerException,
:message
"Syntax error compiling at (/tmp/form-init6924841063651840338.clj:4341:33).",
:data
{:clojure.error/phase :compile-syntax-check,
:clojure.error/line 4341,
:clojure.error/column 33,
:clojure.error/source "/tmp/form-init6924841063651840338.clj"},
:at [clojure.lang.Compiler analyze "Compiler.java" 6812]}
{:type java.lang.RuntimeException,
:message "Unable to resolve symbol: create in this context",
:at [clojure.lang.Util runtimeException "Util.java" 221]}],
:trace
[[clojure.lang.Util runtimeException "Util.java" 221]
[clojure.lang.Compiler resolveIn "Compiler.java" 7418]
[clojure.lang.Compiler resolve "Compiler.java" 7362]
[clojure.lang.Compiler analyzeSymbol "Compiler.java" 7323]
[clojure.lang.Compiler analyze "Compiler.java" 6772]
[clojure.lang.Compiler analyze "Compiler.java" 6749]
[clojure.lang.Compiler$HostExpr$Parser parse "Compiler.java" 1020]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7111]
[clojure.lang.Compiler analyze "Compiler.java" 6793]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7099]
[clojure.lang.Compiler analyze "Compiler.java" 6793]
[clojure.lang.Compiler access$300 "Compiler.java" 38]
[clojure.lang.Compiler$LetExpr$Parser parse "Compiler.java" 6388]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7111]
[clojure.lang.Compiler analyze "Compiler.java" 6793]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7099]
[clojure.lang.Compiler analyze "Compiler.java" 6793]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7099]
[clojure.lang.Compiler analyze "Compiler.java" 6793]
[clojure.lang.Compiler analyze "Compiler.java" 6749]
[clojure.lang.Compiler$InvokeExpr parse "Compiler.java" 3892]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7113]
[clojure.lang.Compiler analyze "Compiler.java" 6793]
[clojure.lang.Compiler analyze "Compiler.java" 6749]
[clojure.lang.Compiler$InvokeExpr parse "Compiler.java" 3892]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7113]
[clojure.lang.Compiler analyze "Compiler.java" 6793]
[clojure.lang.Compiler access$300 "Compiler.java" 38]
[clojure.lang.Compiler$LetExpr$Parser parse "Compiler.java" 6388]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7111]
[clojure.lang.Compiler analyze "Compiler.java" 6793]
[clojure.lang.Compiler analyze "Compiler.java" 6749]
[clojure.lang.Compiler$BodyExpr$Parser parse "Compiler.java" 6124]
[clojure.lang.Compiler$FnMethod parse "Compiler.java" 5471]
[clojure.lang.Compiler$FnExpr parse "Compiler.java" 4033]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7109]
[clojure.lang.Compiler analyze "Compiler.java" 6793]
[clojure.lang.Compiler eval "Compiler.java" 7178]
[clojure.lang.Compiler eval "Compiler.java" 7171]
[clojure.lang.Compiler eval "Compiler.java" 7171]
[clojure.lang.Compiler eval "Compiler.java" 7171]
[clojure.lang.Compiler load "Compiler.java" 7640]
[clojure.lang.Compiler loadFile "Compiler.java" 7578]
[clojure.main$load_script invokeStatic "main.clj" 475]
[clojure.main$init_opt invokeStatic "main.clj" 477]
[clojure.main$init_opt invoke "main.clj" 477]
[clojure.main$initialize invokeStatic "main.clj" 508]
[clojure.main$null_opt invokeStatic "main.clj" 542]
[clojure.main$null_opt invoke "main.clj" 539]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]],
:cause "Unable to resolve symbol: create in this context",
:phase :compile-syntax-check}}
So the issue is probably user generated, but I think we can blame either Clojure or Leiningen for the abysmal error reporting.
Initial debugging steps Before creating a report, especially around exceptions being thrown when running Leiningen, please check if the error still occurs after:
lein upgrade
).~/.lein/profiles.clj
(if present) out of the way. This contains third-party dependencies and plugins that can cause problems inside Leiningen.project.clj
, especially if the problem is with a plugin not working. Old versions of plugins like nREPL and CIDER (as well as others) can cause problems with newer versions of Leiningen.Describe the bug I created a fresh project via
lein new app spec-test-cider
. I edited the source ofsrc/spec_test_cider/core.clj
to require things from test.check, addedtest.check
dependency to project.clj. Then inspec-test-cider
directory, when I started a repl, following error occurs.After a while, it prints
REPL server launch timed out.
and exit. After the above error occurs, lein keep getting the error even if I make the source completely empty or make project.clj default.To Reproduce Steps to reproduce the behavior:
lein new app spec-test-cider
src/spec_test_cider/core.clj
andproject.clj
lein repl
Actual behavior
lein repl
failed with slightly modified source file and project.clj. After that, it continues to occur even with the default project.clj and empty source file.Expected behavior Just start repl
Link to sample project src/spec_test_cider/core.clj
project.clj
Logs full report:
Environment
Leiningen Version: Leiningen 2.9.5 on Java 1.8.0_265 OpenJDK 64-Bit Server VM
Leiningen installation method: via pacman (https://www.archlinux.org/packages/community/any/leiningen/)
JDK Version: openjdk version "1.8.0_265" OpenJDK Runtime Environment (build 1.8.0_265-b01) OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
OS: ManjaroLinux 20.2
Additional context Add any other context you have about the problem here. Did this work previously on older versions of Leiningen, or older JDK's?