This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-24
Channels
- # architecture (4)
- # aws (1)
- # beginners (76)
- # boot (172)
- # cider (17)
- # cljs-dev (10)
- # cljs-experience (24)
- # cljsrn (45)
- # clojure (129)
- # clojure-berlin (1)
- # clojure-finland (1)
- # clojure-italy (8)
- # clojure-seattle-old (1)
- # clojure-sg (1)
- # clojure-spec (31)
- # clojure-uk (28)
- # clojurescript (88)
- # cursive (11)
- # data-science (1)
- # datomic (44)
- # fulcro (48)
- # hoplon (5)
- # jobs (3)
- # jobs-discuss (1)
- # leiningen (6)
- # luminus (42)
- # lumo (17)
- # off-topic (9)
- # om (29)
- # onyx (15)
- # pedestal (7)
- # protorepl (20)
- # re-frame (24)
- # reagent (46)
- # ring-swagger (2)
- # specter (2)
- # sql (3)
- # uncomplicate (58)
- # unrepl (29)
- # yada (5)
#object[TypeError TypeError: goog.net.jsloader.load is not a function]
TypeError: goog.net.jsloader.load is not a function
at adzerk.boot_reload.client.patch_goog_base_BANG_.goog.global.CLOSURE_IMPORT_SCRIPT ()
at Object.goog.importScript_ ()
at Object.goog.writeScripts_ ()
at Object.goog.require [as require__] ()
at Object.clojure.browser.repl.bootstrap.goog.require ()
at eval (eval at <anonymous> (), <anonymous>:1:6)
at
at
at cljs.core.MultiFn.G__12138__2 ()
at cljs.core.MultiFn.G__12138 [as call] ()
Caveat: I don't do any cljs work but that sounds to me like something might be pulling in an incompatible version of the Google JS library?
Hmm, I have the latest cljs version in there, so I would hope it would load the correct one
How do you start your repl? (I just created a test project with that build.boot file and ran boot dev
and that started the watcher...)
Hmm, I get this error when I try that:
boot.user=> (start-repl)
java.lang.IllegalStateException: Can't change/establish root binding of: *cljs-repl-env* with set
So I'm guessing I can't just fire up a new boot repl
and type that in... just a sec...Cool. Learning how the whole cljs thing works is something I should do so this will help 🙂
🙂 I’m itching to do some serious web dev with full-stack Clojure, currently trying to do static react sites. Having the components and css all represented in native Clojure data structures is amazingly simple and powerful
I haven’t even start playing with Macros yet! I’m kinda new to the Lisp world, but am so ready to dive in! I just gotta get past some battles with the tooling lol
OK, all caught up... the WS stuff doesn't seem to work in Microsoft Edge so I had to switch browsers...
(probably because I'm working across VMs)
And I can repro... that's a good first step...
Bing turns up a commit on the Google closure library that "deletes deprecated goog.net.jsloader.load" https://github.com/google/closure-library/commit/988ff900886e959a888485ee56d1540d1bf2f29d so the problem seems to be picking up a more recent version of the Google closure library (from the latest ClojureScript) and Adzerk boot-reload doesn't work with it.
@coetry Looks like you need this in build.boot
:
:dependencies '[[org.clojure/clojurescript "1.9.908"
:exclusions [org.clojure/google-closure-library]]
[org.clojure/google-closure-library "0.0-20170519-fa0499ef"]
That at least lets the require
of Garden complete without an error...
hmmm interesting, maybe that’s a bug experienced when developing in the repl, because i know you for sure want google closure in production
So I guess the Adzerk guys need to update boot-reload
to work with the latest Google closure version.
Note that I excluded it from clojurescript and added a specific dependency on an older version
Hmm, that doesn't get you much further it seems
cljs.user=> (require '[garden.core :refer [css]])
cljs.user=> (css [:body {:font-size "32px"}])
#object[ReferenceError ReferenceError: Can't find variable: garden]
eval code
eval@[native code]
So I'm not sure what to suggest at that point.
This is why we gave up trying to use cljs about two years ago and figured we'd revisit it some day once tooling has become less fragile...
Sorry I can't help more. Dinner time here...
@coetry BTW, I looked a bit more deeply at boot-reload
and it has almost no dependencies and nothing to do with cljs so it's not at fault. Apologies to the Adzerk guys for jumping to that conclusion.
Hopefully someone in #clojurescript -- or someone here with more knowledge of the cljs ecosystem -- can help you. I'll be interested to know what the solution is either way (I'm not in #clojurescript tho').
Anyone an idea why some lein plugins that are not listed in a jar’s pom.xml
would still leak into boot? Example boot -d morse show -d
If you look at the deps tree you’ll see venantius/ultra show up even though that is not listed in the jar’s pom.xml
venantius/ultra
is a tooling thing that you would usually put into profile.clj
, but I thought that was lein-domain
@hkjels yeah I learned about that but also don’t have a profile.clj (not that that should influence boot in any way)
Looks like morse
uses ultra
as a plugin in the :dev
profile -- but I too am puzzled as to why boot
would end up pulling plugins into the mix when they're not mentioned in pom.xml
-- maybe @alandipert or @micha can shed some light?
@U050TNB9F did you try with -vv
to see the debug output? might be an answer in there
That didn't show me anything useful but I did realize that boot
is not use the pom.xml
but the morse-0.2.4.pom
file -- which was generated by Leiningen and does contain the venantius/ultra
dependency without a <scope>
so that seems like a bug in Leiningen to me?
@seancorfield do you consider it more appropriate to use pom.xml or *.pom for dep resolution?
I don't know enough about Maven/Aether/Apache Resolver to offer a useful opinion. I don't know whether Leiningen should or should not add plugins to the .pom
file but it feels wrong to me (or they should, at least, have a different scope). But maybe those two POMs are for different purposes that I'm just missing?
(! 1183)-> ls ~/.m2/repository/morse/morse/0.2.4/
_maven.repositories morse-0.2.4.jar.sha1 morse-0.2.4.pom.sha1
morse-0.2.4.jar morse-0.2.4.pom
<!-- This file was autogenerated by Leiningen.
Please do not edit it directly; instead edit project.clj and regenerate it.
It should not be considered canonical data. For more information see
https://github.com/technomancy/leiningen -->
But it feels like boot
is using the .pom
for resolution -- since ultra
is in the .pom
not the pom.xml
I'm beginning to suspect that ultra
is in there because of a bad local setup by the author at this point...?
how does boot do the voice notifications? like when it says “2 Warnings” and stuff like that?
@seancorfield: It works perfectly fine from a standard clj repel as @hkjels mentioned
I'd tried it in a clj REPL and saw it worked -- but I thought you were trying it in a cljs REPL because it was supposed to work there (and I'd expect a CSS generating library to work in cljs, to be honest).
Yeah i still haven’t figured out why its not working in the cljs repl, which was my ideal goal, but i figwheel sufficies as visual feedback for autocompiled css sheets for now. I’m trying to get away from the notion of the perfect dev environment and just want to start hacking
Is it possible to control the ordering of the resulting classpath inside a :dependencies
vector? I had assumed they'd be ordered by appearance, but they seem to shift if things depend on them.
before I file a bug report, has anyone else noticed that in boot 2.7.2, exceptions raised gy boot print a "line: ..." number but do not print a "file: "some/file.clj"" where the exception was thrown? Changing my boot.properties version to 2.7.1 or 2.7.0 print like I'd expect, but it breaks in 2.7.2
https://discuss.gradle.org/t/how-do-i-control-the-order-of-compile-classpaths/5329/4 seems this might not be possible
Looks like morse
uses ultra
as a plugin in the :dev
profile -- but I too am puzzled as to why boot
would end up pulling plugins into the mix when they're not mentioned in pom.xml
-- maybe @alandipert or @micha can shed some light?
currentoor on macs there's a 'say' command on macs that it shells out, iirc it uses espeak on linux (if available)
drewverlee re: cljs it's not clear that boot pods are fundamentally possible in node, since node doesn't have classloaders, which are the underlying tech on the jvm
drewverlee the fileset and command line parsing stuff is probably ripe for node. another node build tool, broccoli, on which embercli is based, has a fileset-like thing in it
I think they want it like this. But it also means I have to figure out maven. I probably will do that :)
@alandipert oh i see, thanks
i'm relatively ignorant of maven eccentricities, but to me it seems not good for lein to add plugins as deps
It is probably not lein, but the plugin
Looking in more depth, it's only one of the three :dev :plugins
so it makes me wonder whether the author has ultra
as a non-dev dependency, maybe in their ~/.lein/profiles.clj
?
Ultra attaches itself to lein using middleware hook: https://github.com/venantius/ultra/blob/0.4.1/src/ultra/plugin.clj#L94 https://github.com/technomancy/leiningen/blob/master/doc/PLUGINS.md#project-middleware
pom.xml is what you have in your project and maven renames it to *.pom as part of deploy, yes?
Why would they be different then? Different dependencies in each.
And in this case, ultra modifies the projects :dependencies and adds dependency there
So that all the other lein tasks see the ultra also
I think I've dealt with this problem somewhere, but can't remember where
Huh, ultra seems to work differently if it is defined on project dev profile, vs. ~/.lein/profiles.clj
If it is in ~/.lein, it is not added to pom.xml
Based on comparing pom.xml
and morse-0.2.4.pom
, it isn't added to the pom.xml
if it's in :dev
as one of the :plugins
either, but it is added to morse-0.2.4.pom
... So I guess we just chalk this up to ultra
being "badly behaved" and leaking into the artifact's .pom
file (but not pom.xml
-- so why are those different?)
cc @venantius hey! maybe you can shed some light on the above issue and/or have heard of it before 🙂
@venantius to sum the issue up: it seems that the :dev
dependency on ultra
somehow leaks into the .pom
file of the deployed library [morse “0.2.4”]
I would absolutely believe that Ultra is responsible for the issue here as it does modify both :dependencies
and :plugins
@venantius did you consider using :scope "test"
when adding it to :dependencies
? — I guess many people will just not read the note in the README
@venantius morse
doesn't have ultra
as :dev
dependency, but as dev plugin
@juhoteperi that is to be expected - ultra is a plugin
Probably something strange going on with lein profiles also, as there was some dfiference between having ultra on ~/.lein and project.clj
Does the :dev
profile leak? Leiningen claims that the :dev
profile has ^{:pom-scope :test}
set already
If I understand ultra code correctly, the dpendenciy in injected directly to the project, not to project's dev profile?
well at the point at which lein middleware runs I believe the profile has already been resolved
It doesn’t look like plugins in the dev profile get the pom-scope limitation attached. Does that propagate the plugin via the pom? That would seem potentially undesirable.
One test case would be to create project with lein new, add ultra to dev plugins on project.clj and run lein pom
, ultra
will be included in deps
Not sure if pom task works the same as packaging the lib
when running lein jar
, the pom.xml
doesn't have ultra dep
To be honest, I’m inclined to push this back to Boot. It doesn’t sound like Ultra leaks to pom.xml, just to pom, which includes a specific note that it’s Leiningen-internal
The pom
file contains an explicit warning that its data should be considered non-canonical
hmm, now I'm unsure what the original problem even was
because looking at the morse jar, it looks fine
The problem is that somehow ultra
ends up in pom
but not in pom.xml
and that Boot seems to rely on pom
Oh now I see it
~/.m2/repository/morse/morse/0.2.4 master*
❯ cat morse-0.2.4.pom | grep ultra
<artifactId>ultra</artifactId>
because that file is the pom.xml file the user uploaded to clojars or maven central when they pushed the jar
This is a problem with Leiningen also, which can be checked by adding [morse "0.2.4"]
dep to a Lein project and checking lein deps :tree
(ultra will be transitive dep of morse)
the pom.xml file you upload when you push becomes the morse-0.2.4.pom
file we see when we download it from clojars
so something added ultra to the pom.xml that was uploaded via the push task in leiningen
Yeah, that file is used by Maven/Lein/Boot always
maven-resolver nowadays 🙂
or well, I guess we haven't updated yet
when you do the leiningen equivalent of boot push
it generates a pom.xml to upload to the repo with the jar
ultra has done some things internally in leiningen that cause it to think that ultra is a dependency without test scope
the pom.xml file in the jar is generated by a different code path in leiningen probably
I'll open Leiningen issue about this, seems quite strange
Yes, that should work as a workaround
I think I found the reason, both Lein and Ultra work correctly 🙂
Morse adds Ultra to :dev
profile instead of :user
profile
... no this doesn't make any sense, as :user
shouldn't be used on project.clj
but :repl
profile works
@kanwei Doesn't look like that would be caused by Boot-cljs. It would be best to try to reproduce this with cljs.jar (https://clojurescript.org/guides/quick-start) and if this happens with that also, open issue on Cljs