Hi guys I’m having a hard time using any of the cljsjs libraries. I have a feeling there’s something off about my project build settings, maybe I’m using the wrong version of boot-cljs? `(set-env! :source-paths #{"src/"} :resource-paths #{"assets/"} :dependencies '[[org.clojure/clojurescript "1.9.229"] [org.clojure/clojure "1.8.0"] [adzerk/boot-cljs "1.7.228-1"] [cljsjs/cortical-io "1.0-0"] [proto-repl "0.3.1"]]) (require '[adzerk.boot-cljs :refer [cljs]]) (deftask build [] (comp (cljs) (target) (watch) (cljs) (repl))) `
this seems right. Are you requiring cljsjs.cortical-io
somewhere? @mikebelanger
@martinklepsch yeah, here’s the file : (ns cube-test.core
(:require [cljsjs.cortical-io]))``
do you get an error of any kind?
@martinklepsch Sorry for the formatting, the above is the whole file. I’ve tried a bunch of other libraries in cljsjs as well, with the same result. I’ve tried deleting/re-downloading my maven repos as well. Not sure what is going on.
@martinklepsch yeah
java.io.FileNotFoundException: Could not locate cljsjs/cortical_io__init.class or cljsjs/cortical_io.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
@martinklepsch so the above error is the same, regardless of the cljsjs package. Here’s the boot version:
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.7.0
BOOT_VERSION=2.6.0
@martinklepsch I only get that error if I require. Otherwise it loads fine, so I don’t think its a top-level namespace declaration thing.
@martinklepsch Actually, to clarify I’ve only tried using [cljsjs/react "15.3.1-0”]
[cljsjs/three "0.0.76-0”]
and require’d in the same way. Seems like too much of a coincidence.
I’ve looked at all three of those Maven repos, they look like the usual structure.
I’ve based my overall structure on this, https://github.com/clojure-china/minimal-cljs, which seemed to work
@mikebelanger: make sure you relaunch boot when you change deps
Otherwise they don't download
@flyboarder I’m relaunching boot every time, mainly because it doesn’t even make it to the (watch) task 😛. My maven repos appear to have the JARs for these libraries.
Why do you have multiple cljs tasks in your pipeline?
@mikebelanger: also your target task should come last
Repl and watch don't work well together from my experience either
Try just watch cljs target
@flyboarder ok yeah that’s true, no need for additional cljs if always watching.
@flyboarder Ok tried making my build task just (watch) (cljs) (target) — still getting the error. At this point I think it’s easier to just upload the entire project, for anyone interested.
yeah if there is a repo that might help
Ok its at https://github.com/mikebelanger/minimal_cljs_master
adzerk.boot_cljs.util.proxy$clojure.lang.ExceptionInfo$ff19274a: ERROR: No such namespace: cljsjs.three.deps, could not locate cljsjs/three/deps.cljs, cljsjs/three/deps.cljc, or Closure namespace "cljsjs.three.deps" in file /Users/mikebelanger/.boot/cache/tmp/Users/mikebelanger/Downloads/minimal_cljs_master/22z/-grrwi1/minimal_cljs/core.cljs at file src/minimal_cljs/core.cljs
and here’s the error I’m getting.and I dunno if posting my maven repository is useful, but it looks like three has been downloaded, and its all wrapped up in a .jar in the cljsjs directory.
….wait, does boot automatically decompress .jars?
Boot adds the jar contents to the fileset
Sorry classpath
@mikebelanger where are you getting this cljsjs.three.deps
namespace from?
i think you just want cljsjs.three
@flyboarder I based it off of this tutorial : https://github.com/cljsjs/packages/wiki/Using-Packages
I dont see anywhere it requires appending .deps
to the namespace, each package has it’s own readme file in the git repo with how to include it.
I was basing the name off of the .jar structure, as the error messages kept telling me what sort of filenames they expected.
@flyboarder I got the repo here: https://clojars.org/cljsjs/three/versions/0.0.76-0 The only documentation I see is to the original JS library.
@flyboarder yeah I’d go by a README if it existed.
It does I posted the link
All cljsjs packages read me are in the repo :) it would be nice if the site linked to them
@flyboarder Oh I’m a fool! Cool thanks I’ll remember to look at the github repo for now on 😛
Yeah that's the best place to check for documentation usually
yeah it’d be kind of nice if that was linked in the clojars site, but I guess that’s a separate site from cljsjs.
@mikebelanger generally the cljsjs builds reference the original js project repo so i dont think there is anything that actually points to the readme. You kinda have to “know”.
@flyboarder I guess, yeah