Fork me on GitHub
#shadow-cljs
<
2018-12-04
>
vigilancetech00:12:17

lein repl :connect localhost:42659
Connecting to nREPL at localhost:42659
CompilerException java.lang.ClassNotFoundException: clojure.tools.nrepl, compiling:(null:1:82) 
#namespace[user]
Error loading namespace; falling back to user
nil
user=> Bye for now!

vigilancetech00:12:27

from my project deps (in shadow's file)

:dependencies
 [
  [thheller/shadow-cljs "2.7.6"]
  [refactor-nrepl "2.4.0"]
  [org.clojure/clojure "1.10.0-alpha6"]
  [org.clojure/clojurescript "1.10.339"]
  [cider/cider-nrepl "0.19.0-SNAPSHOT"]
  [binaryage/devtools "0.9.10"]
  [adzerk/env                "0.3.1"          :scope "test"]
  [com.rpl/specter "1.1.2"]
;;  [hoplon/hoplon "7.1.0"]
  [hoplon/hoplon "7.3.0-SNAPSHOT"]
;;  [vigilancetech-com/hoplon "6.0.0-alpha17"]
  [cljsjs/markdown "0.6.0-beta1-0"]
  [vigilancetech/ui "0.3.0-SNAPSHOT"]
  ]

royalaid02:12:37

@thheller I am trying to use the :node-library output with AWS Lambda and am running into problems when I take the output and upload it to lambda. Does the output require a specific node version as its minimum?

pez08:12:18

@vigilancetech try with adding [org.clojure/tools.nrepl "0.2.13"] to those dependencies.

pez09:12:24

(Even though I think it used to work with just having the cider deps and shadow injected the rest.)

thheller10:12:04

@royalaid node v6+ is required yes but thats a pretty old version so aws should definitely have that

thheller10:12:15

what is the problem you see?

royalaid20:12:28

Here is a repro, if you do a release and then upload the zip to AWS lambda it just returns null

royalaid20:12:54

Additionally these errors appear in the editor, not sure if they are red herrings

royalaid20:12:52

Specifically I have just zipped and uploaded the target folder in that project

thheller20:12:23

hmm that is odd

thheller20:12:51

seems to work fine in node

thheller20:12:22

but it is trying to create a global variable. maybe they don't allow that for some reason?

royalaid20:12:03

yeah that is what struct me, why is it happy in node?

thheller20:12:46

I'm guessing its just sandboxed stricter than normal node

royalaid20:12:21

Here is the full compiled output

royalaid20:12:26

pretty printed

thheller20:12:04

try 2.7.8. I changed how the exports are generated so it doesn't rely on the global.

Nolan18:12:54

@royalaid just out of curiosity, are there any npm deps in this project? was running into a (potentially) similar thing recently, and wondering if it’s related

royalaid18:12:38

I haven't included any in the example project but plan to do a follow up post leveraging AWS's graphql lib for an example

royalaid18:12:01

but if you want to include npm deps Shadow's docs have a great section on how to do so

Nolan18:12:10

right on. one thing i ran into that may or may not be helpful in your case is that i needed to copy node_modules into the zip, as thomas is undecided on “single-file” node builds. that might be obvious to most people but i spent a decent bit of time figuring that out, especially with :advanced on

royalaid18:12:56

That is good to know, I will include it in some edit's I want to make to the post

👍 1
thheller10:12:03

@vigilancetech do you have a user.clj in your sources that tries to do something with nrepl?

thheller10:12:12

cider-nrepl 0.18+ requires nrepl 0.4+ but you seem to use the older version somewhere somehow?

pez10:12:59

leiningen uses tools.nrepl still, I think.

thheller10:12:28

@pez yes that is true but connecting should still work fine as the protocol itself is unchanged

thheller10:12:40

lein repl :connect localhost:8202
Connecting to nREPL at localhost:8202
shadow.user=>

thheller10:12:52

works fine regardless of nrepl version used

thheller10:12:53

getting tired of this cider stuff constantly breaking ... gonna have to spend some time with it some day ...

pez10:12:36

I think some of it will stabilize when the transition to be nrepl is done.

thheller10:12:36

it has never been "stable" in 5 years so I have my doubts

thheller10:12:41

every time I try it the setup I had before is broken and doesn't work anymore

manuel11:12:38

It used to work better before the move to the new sessions system, but it's not that "unstable" now. 🙂

mdallastella11:12:46

@thheller what ide/editor are you currently using?

richiardiandrea15:12:15

Had a little fun during/after the conj and built a bash script that runs and wait for the watch to be ready and then launches node: https://github.com/elasticpath/fonda/blob/master/scripts/repl To be refined for sure but it works fine for now :)))

👍 3
1
richiardiandrea15:12:40

Just noticed there is a small bug lol

pez19:12:37

@thheller I’m trying to create an npm module of my existing Calva Formatter code, using the recipe you made for me. It builds and run tests, but I don’t know how to run the module so that I can hook the REPL in.