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

Issue starting application from lein template #718

Closed
tjb opened this issue Aug 1, 2020 · 4 comments
Closed

Issue starting application from lein template #718

tjb opened this issue Aug 1, 2020 · 4 comments
Labels
bug Something isn't working jack-in

Comments

@tjb
Copy link

tjb commented Aug 1, 2020

Hello everyone! I recently created a new lein template and I have received the following error in the new repl window

clj::shadow.user=> 
; Debugger initialized
; Evaluating 'afterCLJReplJackInCode'
clj::shadow.user=> 
(start)
; Syntax error compiling at (.calva/output-window/output.repl-file:14:1).
; Unable to resolve symbol: start in this context
[{:file "Compiler.java" :line 6808 :method "analyze" :flags [:tooling :java]}
 {:file "Compiler.java" :line 6745 :method "analyze" :flags [:dup :tooling :java]}
 {:file "Compiler.java" :line 3820 :method "parse" :flags [:tooling :java]}
 {:file "Compiler.java" :line 7109 :method "analyzeSeq" :flags [:tooling :java]}
 {:file "Compiler.java" :line 6789 :method "analyze" :flags [:tooling :java]}
 {:file "Compiler.java" :line 6745 :method "analyze" :flags [:dup :tooling :java]}
 {:file "Compiler.java" :line 6120 :method "parse" :flags [:tooling :java]}
 {:file "Compiler.java" :line 5467 :method "parse" :flags [:tooling :java]}
 {:file "Compiler.java" :line 4029 :method "parse" :flags [:tooling :java]}
 {:file "Compiler.java" :line 7105 :method "analyzeSeq" :flags [:tooling :java]}
 {:file "Compiler.java" :line 6789 :method "analyze" :flags [:tooling :java]}
 {:file "Compiler.java" :line 7174 :method "eval" :flags [:tooling :java]}
 {:file "Compiler.java" :line 7132 :method "eval" :flags [:dup :tooling :java]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/core.clj:3214" :fn "eval"  :method "invokeStatic" :flags [:clj]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/core.clj:3210" :fn "eval"  :method "invoke" :flags [:clj]}
 {:file "jar:file:/home/canti/.m2/repository/nrepl/nrepl/0.7.0/nrepl-0.7.0.jar!/nrepl/middleware/interruptible_eval.clj:91" :fn "evaluate/fn"  :method "invoke" :flags [:tooling :clj]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/main.clj:437" :fn "repl/read-eval-print/fn"  :method "invoke" :flags [:clj]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/main.clj:437" :fn "repl/read-eval-print"  :method "invoke" :flags [:dup :clj]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/main.clj:458" :fn "repl/fn"  :method "invoke" :flags [:clj]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/main.clj:458" :fn "repl"  :method "invokeStatic" :flags [:dup :clj]}
 {:file "jar:file:/home/canti/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/main.clj:368" :fn "repl"  :method "doInvoke" :flags [:clj]}
 {:file "RestFn.java" :line 1523 :method "invoke" :flags [:java]}
 {:file "jar:file:/home/canti/.m2/repository/nrepl/nrepl/0.7.0/nrepl-0.7.0.jar!/nrepl/middleware/interruptible_eval.clj:84" :fn "evaluate"  :method "invokeStatic" :flags [:tooling :clj]}
 {:file "jar:file:/home/canti/.m2/repository/nrepl/nrepl/0.7.0/nrepl-0.7.0.jar!/nrepl/middleware/interruptible_eval.clj:56" :fn "evaluate"  :method "invoke" :flags [:tooling :clj]}
 {:file "jar:file:/home/canti/.m2/repository/nrepl/nrepl/0.7.0/nrepl-0.7.0.jar!/nrepl/middleware/interruptible_eval.clj:155" :fn "interruptible-eval/fn/fn"  :method "invoke" :flags [:tooling :clj]}
 {:file "AFn.java" :line 22 :method "run" :flags [:java]}
 {:file "jar:file:/home/canti/.m2/repository/nrepl/nrepl/0.7.0/nrepl-0.7.0.jar!/nrepl/middleware/session.clj:190" :fn "session-exec/main-loop/fn"  :method "invoke" :flags [:tooling :clj]}
 {:file "jar:file:/home/canti/.m2/repository/nrepl/nrepl/0.7.0/nrepl-0.7.0.jar!/nrepl/middleware/session.clj:189" :fn "session-exec/main-loop"  :method "invoke" :flags [:tooling :clj]}
 {:file "AFn.java" :line 22 :method "run" :flags [:java]}
 {:file "Thread.java" :line 834 :method "run" :flags [:java]}]

I noticed in the settings.json file that this is the configuration

    "calva.replConnectSequences": [
                {
            "name": "Server only - test-app",
            "projectType": "Leiningen",
            "afterCLJReplJackInCode": "(start)",
            "cljsType": "none",
            "menuSelections": {
                "leinProfiles": [
                    "dev"
                ]
            }
        },
        {
            "name": "Server + Client – test-app",
            "projectType": "lein-shadow",
            "afterCLJReplJackInCode": "(start)",
            "cljsType": "shadow-cljs",
            "menuSelections": {
                "leinProfiles": [
                    "dev"
                ],
                "cljsLaunchBuilds": [
                    "app",
                    "test"
                ],
                "cljsDefaultBuild": "app"
            }
        }
    ]
}

However, the (start) function is not found. Prior to the new repl window the application had no problem starting up. I apologize if this is not enough information as I am new to Clojure and unsure what else to add for this bug.

The command I used to generate the template is lein new luminus test-app +cljs +shadow-cljs +re-frame +postgres.

I am selecting Server + Client for the repl.

@tjb
Copy link
Author

tjb commented Aug 1, 2020

I seems the fix is to modify this settings file to be "afterCLJReplJackInCode": "(user/start)",

@bpringe
Copy link
Member

bpringe commented Aug 1, 2020

I think we need to make calva require (refer-all / use?) the user namespace before running the afterCLJReplJackInCode.

@bpringe bpringe added bug Something isn't working jack-in labels Aug 1, 2020
@bpringe
Copy link
Member

bpringe commented Aug 18, 2020

@PEZ Do you think we should change the template instead of changing Calva for this? It seems when choosing the server + client connect sequence with this template, at this line:

if (connectSequence.afterCLJReplJackInCode) {

the outputWindow ns is shadow.user, but start is defined in user, hence the error. I'm not sure if Calva should modify what ns the client has after connection, so it might be wise to change the template as @tjb pointed out.

@bpringe
Copy link
Member

bpringe commented Dec 15, 2020

This was an issue in the template and has been fixed. luminus-framework/luminus-template#520

@bpringe bpringe closed this as completed Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jack-in
Projects
None yet
Development

No branches or pull requests

2 participants