Fork me on GitHub
#portal
<
2020-12-11
>
practicalli_john14:12:56

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.

djblue15:12:12

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.

practicalli_john17:12:39

Ah, if ring is required for the JVM approach to running portal then that's why it's not working... Ooops

practicalli_john17:12:10

Now I just need to find some examples of data that show off portal... Should have something in my many projects... Thanks

practicalli_john17:12:20

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...

practicalli_john17:12:48

I'm running this with Leiningen 2.9.1 on Java 11.0.9.1 OpenJDK 64-Bit Server VM

practicalli_john17:12:54

So nothing fancy...

practicalli_john17:12:48

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

practicalli_john18:12:25

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.

practicalli_john18:12:54

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.

djblue19:12:01

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:

djblue19:12:43

It sounds like you might have a conflicting dependency on http-kit, perhaps lein resolves an older version of http-kit on the classpath.

djblue19:12:05

I think for the missing tap> , maybe portal should explicitly depend on clojure 1.10

👍 1
djblue19:12:14

A lot of these issues feel like dependency version problems

practicalli_john19:12:28

Yes, Leinigen need clojure dependency to be explicit and works

djblue19:12:27

It does look like when published, the clojure 1.10 dep is present

djblue19:12:54

super weird

practicalli_john19:12:30

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...

djblue19:12:20

I regret adding cheshire as a hard dependency 😅

practicalli_john19:12:44

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

💯 1