Fork me on GitHub
#cljsjs
<
2016-09-11
>
mikebelanger14:09:13

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))) `

martinklepsch15:09:54

this seems right. Are you requiring cljsjs.cortical-io somewhere? @mikebelanger

mikebelanger15:09:40

@martinklepsch yeah, here’s the file : (ns cube-test.core (:require [cljsjs.cortical-io]))``

martinklepsch15:09:17

do you get an error of any kind?

mikebelanger15:09:17

@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.

mikebelanger15:09:02

@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.

mikebelanger15:09:44

@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

mikebelanger15:09:53

@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.

mikebelanger15:09:39

@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.

mikebelanger15:09:33

I’ve looked at all three of those Maven repos, they look like the usual structure.

mikebelanger15:09:47

I’ve based my overall structure on this, https://github.com/clojure-china/minimal-cljs, which seemed to work

flyboarder15:09:12

@mikebelanger: make sure you relaunch boot when you change deps

flyboarder15:09:36

Otherwise they don't download

mikebelanger16:09:28

@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.

flyboarder16:09:53

Why do you have multiple cljs tasks in your pipeline?

flyboarder16:09:17

@mikebelanger: also your target task should come last

flyboarder16:09:46

Repl and watch don't work well together from my experience either

flyboarder16:09:01

Try just watch cljs target

mikebelanger16:09:52

@flyboarder ok yeah that’s true, no need for additional cljs if always watching.

mikebelanger17:09:56

@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.

flyboarder17:09:28

yeah if there is a repo that might help

mikebelanger17:09:13

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.

mikebelanger17:09:03

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.

mikebelanger17:09:12

….wait, does boot automatically decompress .jars?

flyboarder18:09:03

Boot adds the jar contents to the fileset

flyboarder18:09:11

Sorry classpath

flyboarder18:09:21

@mikebelanger where are you getting this cljsjs.three.deps namespace from?

flyboarder18:09:13

i think you just want cljsjs.three

flyboarder18:09:09

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.

mikebelanger18:09:31

I was basing the name off of the .jar structure, as the error messages kept telling me what sort of filenames they expected.

mikebelanger18:09:57

@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.

mikebelanger18:09:03

@flyboarder yeah I’d go by a README if it existed.

flyboarder18:09:32

It does I posted the link

flyboarder18:09:39

All cljsjs packages read me are in the repo :) it would be nice if the site linked to them

mikebelanger18:09:43

@flyboarder Oh I’m a fool! Cool thanks I’ll remember to look at the github repo for now on 😛

flyboarder18:09:18

Yeah that's the best place to check for documentation usually

mikebelanger18:09:25

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.

flyboarder19:09:01

@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”.