Does Portal work with Leiningen configured projects? I tried to include portal as a dev dependency in the project.clj configuration, but portal generated errors. If its not designed to work with Leinigen, that's okay. Just wondered if there was a way to make it work.
You should be able to use lein. https://github.com/djblue/portal/blob/master/examples/jvm/project.clj is the example I use for testing.
Ah, if ring is required for the JVM approach to running portal then that's why it's not working... Ooops
Now I just need to find some examples of data that show off portal... Should have something in my many projects... Thanks
I am still getting the same error when evaluating (require '[portal.api :as portal])
, even with the simplest leiningen project
Syntax error compiling at (portal/runtime/jvm/launcher.clj:48:38).
No such var: http/server-port
It works fine with deps.edn and Clojure CLI tools, just doesnt like running under Leiningen
I'll take a look at the line in the code the error is reporting...I'm running this with Leiningen 2.9.1 on Java 11.0.9.1 OpenJDK 64-Bit Server VM
So nothing fancy...
Hmm, I cloned the portal repository on GitHub and ran the jvm example without any problems... very strange. So something just not right with my project.... I'll do a diff
I seem to be finding some interesting edge cases.
I can run the jvm example from the command line, using lein repl
however running from Calva jack-in it is not finding tap>
Adding the org.clojure/clojure dependency explicitly makes running the portal jvm example work from Calva.
How bizzare. I get a conflict with the scicloj/notespace library when running a Clojure project with Leiningen. However, Portal works just fine with the same project. Everyone seems happy using Clojure CLI tools, so I'll leave it there.
So you don't need ring to use portal for jvm, it was more just an example app. Portal brings http-kit for the http server which is interesting that you got http/server-port
not found, because that's me using http-kit :thinking_face:
It sounds like you might have a conflicting dependency on http-kit, perhaps lein resolves an older version of http-kit on the classpath.
I think for the missing tap>
, maybe portal should explicitly depend on clojure 1.10
A lot of these issues feel like dependency version problems
Yes, Leinigen need clojure dependency to be explicit and works
It does look like when published, the clojure 1.10 dep is present
super weird
and yes, some dependency conflict somewhere... but luckily we are happy not to use Leiningne for this project so I'm not going to try resolve it. There are lots of dependencies to trim from the scicloj/notespace library first Oh there is cheshire... depends on a library that often causes these types of issues when there are different versions...
I regret adding cheshire
as a hard dependency 😅
You are not the only developer to regret this 🙂 I will just get on with enjoying using Portal for the rest of the weekend, thanks