This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-21
Channels
- # announcements (2)
- # aws (1)
- # beginners (172)
- # boot (3)
- # calva (19)
- # cider (18)
- # clj-kondo (5)
- # cljsrn (18)
- # clojure (47)
- # clojure-europe (9)
- # clojure-finland (7)
- # clojure-italy (3)
- # clojure-nl (15)
- # clojure-spec (20)
- # clojure-sweden (2)
- # clojure-uk (72)
- # clojurescript (45)
- # cursive (42)
- # datomic (6)
- # duct (4)
- # emacs (4)
- # expound (48)
- # figwheel-main (7)
- # fulcro (64)
- # graphql (8)
- # hoplon (9)
- # hyperfiddle (1)
- # jackdaw (8)
- # jobs (4)
- # jobs-discuss (61)
- # klipse (5)
- # leiningen (6)
- # off-topic (72)
- # pathom (2)
- # planck (11)
- # re-frame (1)
- # reagent (3)
- # reitit (16)
- # remote-jobs (17)
- # ring-swagger (3)
- # shadow-cljs (49)
- # spacemacs (12)
- # sql (3)
- # tools-deps (124)
- # vim (64)
- # xtdb (4)
I'm hitting an error with shadow-cljs release
and I'm not sure what is causing it. shadow-cljs watch
still works fine.
should be
[com.google.javascript/closure-compiler-unshaded "v20190325"]
[org.clojure/google-closure-library "0.0-20190213-2033d5d9"]
[thheller/shadow-cljs "2.8.36"]
[com.bhauman/cljs-test-display "0.1.1"]
[com.cognitect/transit-clj "0.8.313"]
[com.cognitect/transit-cljs "0.8.256"]
[com.google.javascript/closure-compiler-unshaded "v20190325"]
[com.wsscode/pathom "2.2.7" :exclusions [[org.clojure/data.json] [fulcrologic/fulcro] [camel-snake-kebab]]]
[com.wsscode/spec-inspec "1.0.0-alpha2"]
[edn-query-language/eql "0.0.3"]
[thheller/shadow-cljs "2.8.36"] -> [org.clojure/google-closure-library "0.0-20190213-2033d5d9"] -> [org.clojure/google-closure-library-third-party "0.0-20190213-2033d5d9"]
what is your :modules
config? the exception looks like something isn't quite right with the modules
:main {:target :browser
:output-dir "resources/public/js/main"
:asset-path "/js/main"
:build-hooks [(gsv.api.mutations/recalc)]
:modules {:shared {:entries []}
:web-shared {:entries []
:depends-on #{:shared}}
:worker-shared {:entries []
:depends-on #{:shared}}
:app {:entries [gsv.client]
:depends-on #{:web-shared}}
:fetch-worker {:entries [gsv.fetch-worker]
:depends-on #{:worker-shared}
:web-worker true}
:filter-worker {:entries [gsv.filter-worker]
:depends-on #{:worker-shared}
:web-worker true}}
/**
* Finds the deepest common dependency of two modules, including the
* modules themselves.
*
* @param m1 A module in this graph
* @param m2 A module in this graph
* @return The deepest common dep of {@code m1} and {@code m2}, or null if
* they have no common dependencies
*/
public JSModule getDeepestCommonDependencyInclusive(
just adding it to :app wasn't enough but adding that to the other worker modules seems to have done the trick! Thanks @thheller!
would have expected the logic the account for transitive deps but I guess it doesn't
Hi all š Is there something I'm missing here? I have my code under src/
and tests under test/
and I added them both to source-paths
but yarn shadow-cljs compile test
just doesn't find the test namespace under test/
. All seems to work fine and the test namespace is found when I move the test namespace under src
. Here's my shadow-cljs.edn
:
;; shadow-cljs configuration
{:source-paths ["src" "test"]
:deps true
:builds
{:flex-cli {:target :node-script
:output-to "target/main.js"
:main sharetribe.flex-cli.core/main}
:test {:target :node-test
:output-to "target/tests.js"
:autorun true}}}
And when I run yarn shadow-cljs compile test
it doesn't find any tests:
ā flex-cli git:(master) ā yarn shadow-cljs compile test
yarn run v1.9.4
warning package.json: No license field
$ /Users/mikko/Documents/Projects/sharetribe/flex-cli/node_modules/.bin/shadow-cljs compile test
shadow-cljs - config: /Users/mikko/Documents/Projects/sharetribe/flex-cli/shadow-cljs.edn cli version: 2.8.37 node: v10.11.0
shadow-cljs - starting via "clojure"
[:test] Compiling ...
========= Running Tests =======================
Ran 0 tests containing 0 assertions.
0 failures, 0 errors.
===============================================
[:test] Build completed. (27 files, 1 compiled, 0 warnings, 1,63s)
āØ Done in 10.35s.
The test file under test/sharetribe/flex-cli/hello_world_test.cljs
looks like this:
(ns sharetribe.flex-cli.hello-world-test
(:require [cljs.test :refer-macros [deftest is]]))
(deftest failing
(is (= "hello" "world")))
So what I'm expecting is that the yarn shadow-cljs compile test
would find and run the test which should fail. What I actually see is that the compile doesn't find the test.
Any tips what am I doing wrong or how to debug further? Thanks!Ahaa! Found it. :deps true
was the reason here. Turning it to false
fix it and now the test is found.
And of course then I need to set :paths
in deps.edn
I'm having a similar problem that tests are not found when running
npx shadow-cljs compile test && node out/node-tests.js
shadow-cljs.edn
{:source-paths ["src/main"
"src/test"]
:dev-http {8020 "public"
8021 "out/test"}
:builds {
:test {:target :node-test
:output-to "out/node-tests.js"}
:browser-test {:target :browser-test
:test-dir "out/test"}}}
I don't have deps.edn
adding :deps false
didn't help.
In visual studio code (with appropriate extensions) clicking on run button beside the test (or namespace) gives same result
; Running tests for the following namespaces:
; demo.app-test
; No tests found. š±, ns: 0, vars: 0
shadow-cljs doesn't emit any emojis ever, so this No tests found. :scream:, ns: 0, vars: 0
is not from shadow-cljs
@thheller actual test file copied from shadow-cljs docs src/test/demo/app_test.cljs
(ns demo.app-test
(:require [cljs.test :refer (deftest is)]))
(deftest a-failing-test
(is (= 1 2)))
terminal output
ā Arthya git:(cash-only) ā pnpm shadow-cljs compile test
shadow-cljs - config: /Users/nik/Repo/Arthya/shadow-cljs.edn
shadow-cljs - connected to server
[:test] Compiling ...
[:test] Build completed. (50 files, 1 compiled, 0 warnings, 0.35s)
ā Arthya git:(cash-only) ā node out/node-tests.js
Ran 0 tests containing 0 assertions.
0 failures, 0 errors.
I couldn't figure out the reason so was trying different things (including vscode)shadow-cljs - connected to server
means shadow-cljs is already running elsewhere. is it possible this has been running since before you added src/test
to :source-paths
, or the tests for that matter?
I'm now so used to things in clj world just working that restart didn't make it as debug step š
Ahaa! Found it. :deps true
was the reason here. Turning it to false
fix it and now the test is found.
if you set :deps true
the :source-paths
from shadow-cljs.edn
do not apply and only use the ones defined in deps.edn
Yeps, that seems to be the case and makes totally sense now
I'm having a similar problem that tests are not found when running
npx shadow-cljs compile test && node out/node-tests.js
shadow-cljs.edn
{:source-paths ["src/main"
"src/test"]
:dev-http {8020 "public"
8021 "out/test"}
:builds {
:test {:target :node-test
:output-to "out/node-tests.js"}
:browser-test {:target :browser-test
:test-dir "out/test"}}}
I don't have deps.edn
adding :deps false
didn't help.
In visual studio code (with appropriate extensions) clicking on run button beside the test (or namespace) gives same result
; Running tests for the following namespaces:
; demo.app-test
; No tests found. š±, ns: 0, vars: 0