Fork me on GitHub

I’m trying to use the npm library video.js The JS docs for video.js ( for use in react says:

import videojs from 'video.js'
and use it like this:
this.player = videojs(this.videoNode, this.props ...)
I do a require in my cljs file:
   ["video.js" :as vjs])
and I’ve tried
   ["video.js" :default videojs])
But in the first case vjs/videojs is undefined as is videojs in the second case. Am I doing something stupid, or is something amiss like having the . in the package name is screwing things up?


I just tried putting the actual js file video.js into my work directory and require it as ["./video.js" :as vjs] and ["./video.js" :default videojs] and its behaving the same so I don’t think it’s because of the period. Its something with video.js is setup? They use videojs both as the. top namespace and as the function that effectively instantiates the instance. I don’t know it that is particularly weird for JS or not… They mention it in their docs on videojs : > The `videojs()` function doubles as the main function for users to create a instance as well as the main library namespace. -


Hmm, if I put <script src=""></script> in my index.html and remove the requires for video.js and refer to it as js/videojs it works….


@rberger it probably is (:require ["video.js" :as videojs]) and videojs directly, not the vjs/videojs alias you tried before.


@thheller That seems to have been it. Now I just. have to figure out how to actually use this thing. Its showing up in my dom as a video element but not playing my streams. But this isn’t a shadow-cljs problem! Thanks again!


By the way, this really tweaks my mental model of :require and :as I always had assumed the :as value was an arbitrary label/symbol…


yeah its weird but string requires are the exception to the rule of :as being just an alias for alias/foo

Diogo Vasconcelos08:05:33

Hi. I am getting the following error when I try to compile any shadow-cljs target from my project. It used to work, but now it errors and I am not sure what changed. Maybe you can help me out figuring out what is wrong:

shadow-cljs - starting via "clojure"
[:dev] Compiling ...
Execution error (AssertionError) at (data.clj:214).
Assert failed: (rc/valid-resource? rc)

Full report at:

Diogo Vasconcelos08:05:19

thanks in advance 🙂


hmm not sure. which version is this? in deps.edn?

Diogo Vasconcelos09:05:02

of shadow-cljs? 2.9.10

Diogo Vasconcelos09:05:51

(I was on 2.8.83 and got the same error, updated, got a nicer error message 🙂 but still the same issue)


yeah I'll definitely improve that error message. the assert is useless 😛


I don't have any specific idea why this would fail.


try running shadow-cljs clj-repl and then


(in-ns '
(defn add-source [state {:keys [resource-id resource-name] :as rc}]
  (when-not (rc/valid-resource? rc)
    (throw (ex-info "invalid resource" {:rc rc})))

  (-> state
      (update :sources assoc resource-id rc)
      (add-provides rc)
        (update :name->id assoc resource-name resource-id)


then (shadow.cljs.devtools.api/compile :dev)

Diogo Vasconcelos09:05:21> (shadow.cljs.devtools.api/compile :dev)
[:dev] Compiling ...
invalid resource
{:rc {:cache-key ["5b0a111dc988bc0136ede52338f0c7cd98f61a45"], :ns-info {:rename-macros nil, :renames {}, :meta {:file "repl.cljs", :line 1, :column 5, :end-line 1, :end-column 9}, :use-macros nil, :excludes #{}, :name repl, :imports nil, :requires {cljs-bean.core cljs-bean.core, cljs.pprint cljs.pprint, pprint cljs.pprint, promesa.core promesa.core, p promesa.core, cljs.core cljs.core, goog goog}, :seen #{:require}, :uses {->clj cljs-bean.core}, :require-macros {cljs.core cljs.core}, :cljc false, :flags {:require #{}}, :js-deps {}, :deps [goog cljs.core cljs-bean.core cljs.pprint promesa.core]}, :ns repl, :output-name "repl.js", :file #object[ 0x32a1aabf "/home/diogovasconcelos/git-projects/core-banking-repos/core-banking-platform/service/banking-errands/dev/repl.cljs"], :resource-id [ "repl.cljs"], :resource-name "repl.cljs", :type :cljs, :last-modified -3600000, :requires #{cljs-bean.core promesa.core cljs.core goog cljs.pprint}, :macro-requires #{cljs.core}, :url #object[ 0x6b7f46f6 "file:/home/diogovasconcelos/git-projects/core-banking-repos/core-banking-platform/service/banking-errands/dev/repl.cljs"], :provides #{repl}, :deps [goog cljs.core cljs-bean.core cljs.pprint promesa.core]}}
ExceptionInfo: invalid resource (NO_SOURCE_FILE:14) (NO_SOURCE_FILE:12) (data.clj:267) (data.clj:259) (resolve.clj:550) (resolve.clj:510) (resolve.clj:561) (resolve.clj:557) (resolve.clj:571) (resolve.clj:570)
	clojure.lang.PersistentVector.reduce (
	clojure.core/reduce (core.clj:6827)
	clojure.core/reduce (core.clj:6810)
	shadow.cljs.util/reduce-> (util.clj:47)
	shadow.cljs.util/reduce-> (util.clj:46) (resolve.clj:582) (resolve.clj:573) (modules.clj:265) (modules.clj:261) (modules.clj:251)
	clojure.lang.PersistentVector.reduce (
	clojure.core/reduce (core.clj:6827)
	clojure.core/reduce (core.clj:6810) (modules.clj:271) (modules.clj:270) (modules.clj:325) (modules.clj:316) (build.clj:395) (build.clj:389) (build.clj:403) (build.clj:397)
	shadow.cljs.devtools.api/compile* (api.clj:315)
	shadow.cljs.devtools.api/compile* (api.clj:311)
	shadow.cljs.devtools.api/compile!/body-fn--17311--auto----17398 (api.clj:324)
	shadow.cljs.devtools.api/compile! (api.clj:322)
	shadow.cljs.devtools.api/compile! (api.clj:319)
	shadow.cljs.devtools.api/compile (api.clj:331)
	shadow.cljs.devtools.api/compile (api.clj:326)
	shadow.cljs.devtools.api/compile (api.clj:328)
	shadow.cljs.devtools.api/compile (api.clj:326) (NO_SOURCE_FILE:22) (NO_SOURCE_FILE:22)
	clojure.lang.Compiler.eval (
	clojure.lang.Compiler.eval (
	clojure.core/eval (core.clj:3214)
	clojure.core/eval (core.clj:3210)
	shadow.cljs.devtools.server.socket-repl/repl/fn--17818 (socket_repl.clj:63)
	clojure.main/repl/read-eval-print--9086/fn--9089 (main.clj:437)
	clojure.main/repl/read-eval-print--9086 (main.clj:437)
	clojure.main/repl/fn--9095 (main.clj:458)
	clojure.main/repl (main.clj:458)
	clojure.main/repl (main.clj:368)
	shadow.cljs.devtools.server.socket-repl/repl (socket_repl.clj:30)
	shadow.cljs.devtools.server.socket-repl/repl (socket_repl.clj:28)
	shadow.cljs.devtools.server/from-cli (server.clj:678)
	shadow.cljs.devtools.server/from-cli (server.clj:589)
	clojure.lang.Var.applyTo (
	clojure.core/apply (core.clj:665)
	clojure.core/apply (core.clj:660)
	shadow.cljs.devtools.cli-actual/lazy-invoke (cli_actual.clj:23)
	shadow.cljs.devtools.cli-actual/lazy-invoke (cli_actual.clj:20)
	shadow.cljs.devtools.cli-actual/blocking-action (cli_actual.clj:129)
	shadow.cljs.devtools.cli-actual/blocking-action (cli_actual.clj:116)
	shadow.cljs.devtools.cli-actual/main (cli_actual.clj:177)
	shadow.cljs.devtools.cli-actual/main (cli_actual.clj:132)
	clojure.core/apply (core.clj:669)
	clojure.core/apply (core.clj:660)
	shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:219)
	shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:217)
	clojure.lang.Var.applyTo (
	clojure.core/apply (core.clj:665)
	clojure.core/apply (core.clj:660)
	shadow.cljs.devtools.cli/-main (cli.clj:75)
	shadow.cljs.devtools.cli/-main (cli.clj:67)
	clojure.lang.Var.applyTo (
	clojure.core/apply (core.clj:665)
	clojure.main/main-opt (main.clj:514)
	clojure.main/main-opt (main.clj:510)
	clojure.main/main (main.clj:664)
	clojure.main/main (main.clj:616)

-3600000 - failed: nat-int? in: [:last-modified] at: [:last-modified] spec:

Diogo Vasconcelos09:05:19

thanks for looking into this so quickly btw 🙂


can you check stat /home/diogovasconcelos/git-projects/core-banking-repos/core-banking-platform/service/banking-errands/dev/repl.cljs or so?


I have no idea how it gets a negative timestamp?

Diogo Vasconcelos09:05:00

yeah, something is screwed with the modify date on that file:

File: /home/diogovasconcelos/git-projects/core-banking-repos/core-banking-platform/service/banking-errands/dev/repl.cljs
  Size: 596       	Blocks: 8          IO Block: 4096   regular file
Device: fd01h/64769d	Inode: 9570063     Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1001/diogovasconcelos)   Gid: ( 1001/diogovasconcelos)
Access: 2020-05-28 10:43:16.172569415 +0200
Modify: 1970-01-01 00:00:00.000000000 +0100
Change: 2020-05-20 14:58:43.953551480 +0200
 Birth: 2020-02-21 10:50:27.964589751 +0100


Modify: 1970-01-01 00:00:00.000000000 +0100?


is this running in a container or so?


maybe just try to touch the file to get an updated timestamp?

Diogo Vasconcelos09:05:19

and I updated it and now the dates are correct. It still fails. I am going to check if other files got this problem and let you know

Diogo Vasconcelos09:05:34

yeah. all the files had the dates screwed (and I think you are right, I did mess with docker and mounting this folder). It works now (I re-cloned the repo)

Diogo Vasconcelos09:05:43

sorry for the trouble


thats weird. how does a file get a negative last-modified timestamp?


:last-modified -3600000


I didn't even know that was possible 😛

😅 4
Ian Fernandez11:05:56

Hello guys, How can I use the "shadow.user" ns that emacs initiates using npx shadow-cljs but starting from cider?

Ian Fernandez11:05:23

I'm having some trouble using cider to start a repl and simply using: (ns user (:require [shadow.cljs.devtools.api :as shadow.api] [shadow.cljs.devtools.server :as shadow.server])) (defn -main {:shadow/requires-server true} [& _] (shadow.server/start!) (shadow.api/watch :my-project))

Ian Fernandez11:05:51

when I use, (shadow.api/rep :my-project)

Ian Fernandez11:05:14

I don't have a repl on cider's repl, I have a repl on stdin on emacs


@d.ian.b if you get a stdin REPL you are not connecting to the shadow-cljs nrepl server

Ian Fernandez11:05:48

yeah, there's a way to start to shadow-cljs nrepl from clj with cider?


I don't know enough about cider to answer that


but if you connect to the nrepl provided by it you can just configure the shadow-cljs middleware


then the repl should also just work

Ian Fernandez11:05:10

there's a way to use this on clj tools.deps?


cider defaults to using .nrepl.edn or so I think. ask in #cider about how to configure middleware

clj 4

I don't use cider so I have no clue how current the instructions here are


thats all I can link you to unfortunately


I should have known ... never change a running system ... :face_vomiting:


I'm getting this on 2.9.10


[:ddplugin] Configuring build.
[:ddplugin] Compiling ...
[:ddplugin] Build failure:
no output for id: [ "goog/base.js"]
{:resource-id [ "goog/base.js"]}
ExceptionInfo: no output for id: [ "goog/base.js"]! (data.clj:196)! (data.clj:192) (build.clj:26) (build.clj:22) (build.clj:97)
	clojure.core/map/fn--5866 (core.clj:2753)
	clojure.lang.LazySeq.sval (
	clojure.lang.LazySeq.seq (
	clojure.lang.RT.seq (
	clojure.core/seq--5402 (core.clj:137)
	clojure.core.protocols/seq-reduce (protocols.clj:24)
	clojure.core.protocols/fn--8146 (protocols.clj:75)
	clojure.core.protocols/fn--8146 (protocols.clj:75)
	clojure.core.protocols/fn--8088/G--8083--8101 (protocols.clj:13)
	clojure.core/reduce (core.clj:6828)
	clojure.core/into (core.clj:6895)
	clojure.core/into (core.clj:6887) (build.clj:99) (build.clj:69) (build.clj:107) (build.clj:105) (build.clj:407) (build.clj:397)
	shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:345)
	shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:327)
	shadow.cljs.devtools.server.worker.impl/eval55641/fn--55643 (impl.clj:779)
	clojure.lang.MultiFn.invoke (
	shadow.cljs.devtools.server.util/server-thread/fn--55247/fn--55248/fn--55256 (util.clj:285)
	shadow.cljs.devtools.server.util/server-thread/fn--55247/fn--55248 (util.clj:284)
	shadow.cljs.devtools.server.util/server-thread/fn--55247 (util.clj:257) (


only happens when there's already a cached version


hmm strange


just shadow-cljs watch ddplugin and fails immediately?


Hello all, for this message:

The thheller/shadow-cljs dependency in shadow-cljs.edn was ignored.
can´t I use dependency anymore?


sorry, I think I asked a dumb question


shadow-cljs knows that you are gonna use shadow-cljs. you don't need to declare it in shadow-cljs.edn.