This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-12
Channels
- # beginners (49)
- # boot (2)
- # cider (62)
- # clara (3)
- # cljdoc (5)
- # cljs-dev (7)
- # cljsrn (2)
- # clojure (68)
- # clojure-spec (23)
- # clojure-uk (4)
- # clojurescript (172)
- # conf-proposals (8)
- # core-async (1)
- # cursive (1)
- # datomic (12)
- # duct (1)
- # figwheel (22)
- # figwheel-main (11)
- # fulcro (23)
- # hoplon (9)
- # jobs-discuss (13)
- # lambdaisland (3)
- # lein-figwheel (119)
- # off-topic (43)
- # onyx (1)
- # re-frame (18)
- # ring (1)
- # shadow-cljs (120)
- # tools-deps (4)
Hi guys. I’m new to clojure and shadow-cljs. I encountered this error when shadow-cljs watch app
shadow-cljs - config: /Users/yqrashawn/workspace/HOME/right-site/shadow-cljs.edn cli version: 2.4.33 node: v9.8.0
shadow-cljs - starting ...
Aug 12, 2018 9:54:04 AM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
Aug 12, 2018 9:54:04 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
Exception in thread "main" java.lang.AssertionError: Assert failed: (qualified-symbol? sym)
at shadow.cljs.devtools.server.nrepl04$middleware_load.invokeStatic(nrepl04.clj:269)
at shadow.cljs.devtools.server.nrepl04$middleware_load.invoke(nrepl04.clj:269)
at clojure.core$map$fn__5587.invoke(core.clj:2745)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:528)
at clojure.core$seq__5124.invokeStatic(core.clj:137)
at clojure.core$filter$fn__5614.invoke(core.clj:2801)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:528)
at clojure.core$seq__5124.invokeStatic(core.clj:137)
at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:24)
at clojure.core.protocols$fn__7835.invokeStatic(protocols.clj:75)
at clojure.core.protocols$fn__7835.invoke(protocols.clj:75)
at clojure.core.protocols$fn__7781$G__7776__7794.invoke(protocols.clj:13)
at clojure.core$reduce.invokeStatic(core.clj:6748)
at clojure.core$into.invokeStatic(core.clj:6815)
at clojure.core$into.invoke(core.clj:6807)
{:nrepl {:port 9898
:middleware [[cider/piggieback "0.3.5"]]}
:http {:port 3333
:host "0.0.0.0"}
:source-paths ["src/clj" "src/cljs"]
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.10.238"]
[reagent "0.7.0"]
[re-frame "0.10.5"]
;; [secretary "1.2.3"]
[garden "1.3.5"]
[ns-tracker "0.3.1"]
[compojure "1.5.0"]
[bidi "2.1.3"]
[yogthos/config "0.8"]
[ring "1.4.0"]
[re-pressed "0.2.2"]
[re-frisk "0.5.3"]
[binaryage/devtools "0.9.10"]
[day8.re-frame/re-frame-10x "0.3.3"]]
:builds
{:app {:target :browser
:output-dir "resources/public/js/compiled/"
:asset-path "js/compiled/out"
:modules {:main {:entries [right-site.core]}}
:devtools {:http-root "resources/public"
:http-port 3000
:http-host "0.0.0.0"
:open-file-command ["emacsclient" "-n" ["+%s:%s" :line :column] :file]
:autoload true}}}}
src
├── clj
│ └── right_site
│ ├── core.clj
│ ├── css.clj
│ ├── handler.clj
│ └── server.clj
└── cljs
└── right_site
├── config.cljs
├── core.cljs
├── db.cljs
├── events.cljs
├── home-page
│ ├── home_page_data.cljs
│ └── home_page_views.cljs
├── login-page
│ ├── login_page_data.cljs
│ └── login_page_views.cljs
├── routes.cljs
├── subs.cljs
└── views.cljs
I think it’s unnecessary, since shadow-cljs provides it’s own version of piggieback
not exactly sure why it’s throwing, but you should be fine to develop without it as a dependency
I created a issue in case someone else stuck with the same question. https://github.com/thheller/shadow-cljs/issues/366
@namy.19 thanks for the report. I'll probably just filter out manually specified piggieback
middleware in the future.
When I try to start the repl in emacs I keep getting an error
error in process sentinel: Could not start nREPL server: shadow-cljs - config: .../shadow-cljs.edn cli version: 2.4.11 node: v10.8.0
shadow-cljs - connected to server
server already running
@urbanslug shadow-cljs stop
should stop it
btw @thheller when I put the constants in my html they tended to get lost on files changes
(defonce app-state (r/atom default-app-state))
where default-app-state is an objectI don't know your app setup but if state in the atom gets lost that on your side of things
so my current thought is to continue providing the shadow-cljs-jar
package but not depend on it
previously shadow-cljs
just depended on shadow-cljs-jar
but I want to get rid of that extra npm
download since it mostly wasted
only considering adding it back for chinese users as an alternate to the github download if that so unreliable
hmm I could create a shadow-cljs-standalone
package which downloads shadow-cljs
and the launcher (via npm)
oh there is actually one new thing. @currentoor the change to :npm-script
is in 2.5.0
so it should be now possible to do the raspberry pi development we talked about.
Thank you so much!
I’ll try later today
you'll probably need to set :output-to "out/script.js" :output-dir "out/something"
. by default :output-dir
is set to something that might not be reachable on the pi
so i made a directory on my laptop pi
and mounted the raspberry pi’s filesystem on it
set these values
:output-dir "pi/nodetest/ucv_tcs"
:output-to "pi/nodetest/main.js"
but when i try to run the compiled file i get
Error: ENOENT: no such file or directory, open '/Users/currentoor/src/ucv/pi/nodetest/ucv_tcs/cljs-runtime/goog.debug.error.js'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at global.SHADOW_IMPORT (/home/pi/nodetest/main.js:46:15)
at /home/pi/nodetest/main.js:3005:1
at Object.<anonymous> (/home/pi/nodetest/main.js:3200:3)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
oh wait i forgot to update shadow-cljs
:man-facepalming:
yeah @thheller i’m still getting that error even after updating
i see this in the compiled out put
var SHADOW_IMPORT_PATH = "/Users/currentoor/src/ucv/pi/nodetest/ucv_tcs/cljs-runtime";
maybe i misunderstood what you said earlier, i thought this was no longer going to be an absolute path?
if i manually edit that variable to be a relative path it works, except the repl doesn’t seem to connect
REPL client error { Error: connect ECONNREFUSED 127.0.0.1:9630
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 9630 }
REPL client disconnected
not a caching thing, i tried lein clean
hmm, i nuked node_modules and did an npm install
these lines are printed when i start shadow-cljs
shadow-cljs - config: /Users/currentoor/src/ucv/shadow-cljs.edn cli version: 2.5.0 node: v10.4.1
shadow-cljs - running: lein with-profile cljs run -m shadow.cljs.devtools.cli --npm watch tcs
yes i am
yes that was it
i forgot project.clj
had it too
that worked beautifully!
=>> yarn watch
yarn run v1.9.4
$ shadow-cljs watch client
shadow-cljs - config: /Users/chen/repo/mvc-works/calcit-workflow/shadow-cljs.edn cli version: 2.5.0 node: v10.8.0
shadow-cljs - starting 2.5.0 with launcher 2.0.0 ...
Downloading: thheller/shadow-cljs/2.5.0/shadow-cljs-2.5.0-aot.jar from
Downloading: org/clojure/clojurescript/1.10.339/clojurescript-1.10.339-slim.jar from
Downloading: com/google/javascript/closure-compiler-externs/v20180805/closure-compiler-externs-v20180805.jar from
Downloading: com/google/javascript/closure-compiler-unshaded/v20180805/closure-compiler-unshaded-v20180805.jar from
Downloading: com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar from
Aug 13, 2018 2:34:44 AM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
Aug 13, 2018 2:34:44 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
shadow-cljs - HTTP server for :client available at
shadow-cljs - server version: 2.5.0
shadow-cljs - server running at
shadow-cljs - socket REPL running on port 53885
shadow-cljs - nREPL server started on port 53887
shadow-cljs - watching build :client
[:client] Configuring build.
[:client] Compiling ...
[:client] Build completed. (198 files, 98 compiled, 0 warnings, 32.43s)
does shadow-cljs offer any way to run a script before compilation. What I'm looking to do, is compiling for browser where I sed replace a variable with base64 of a .wasm file but compile to node without that replace. It would be nice to avoid having two copies of that emscripten bindings file, as one would include few mb string and the other not.
either https://shadow-cljs.github.io/docs/UsersGuide.html#clj-run or https://shadow-cljs.github.io/docs/UsersGuide.html#build-hooks
wont base64 make the file huge? isn't it better to download it independently via xhr?
yes it makes a very huge file. But the mechanism in the wasm bindings makes it bit tedious to bundle the app, it's a window.fetch and needs cors to work right, as well as not working with file:// protocol. As I'm makeing a library that mostly non-programmers use, just one script tag makes it easier for everyone.