This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-30
Channels
- # announcements (1)
- # beginners (94)
- # calva (12)
- # cider (5)
- # cljdoc (4)
- # cljs-dev (4)
- # clojure (170)
- # clojure-austin (2)
- # clojure-dev (45)
- # clojure-germany (53)
- # clojure-italy (20)
- # clojure-nl (6)
- # clojure-spec (25)
- # clojure-uk (242)
- # clojurescript (161)
- # cursive (16)
- # data-science (3)
- # datomic (20)
- # defnpodcast (6)
- # emacs (40)
- # events (1)
- # fulcro (80)
- # funcool (46)
- # jobs (1)
- # leiningen (23)
- # liberator (2)
- # lumo (43)
- # mount (3)
- # off-topic (21)
- # onyx (1)
- # pedestal (15)
- # re-frame (23)
- # reitit (4)
- # schema (1)
- # sfcljs (1)
- # shadow-cljs (167)
- # spacemacs (1)
- # tools-deps (21)
- # yada (2)
I give up, it builds just fine in docker container
so something is wrong on my mac
@flyboarder did you verify if app
still has all the properties you expect? I know its easy to suspect shadow-cljs doing something wrong (and it might) but its just as likely that you accidentally upgraded something else and app
just isn't what it used to be anymore?
Are there any known reasons how a browser REPL gets into a state where it returns [:did-not-find some.namespace]
for namespaces that are part of the build?
maybe my flow is wrong, I was trying something new, starting with (shadow/watch :browser {:autobuild false})
so that it doesn’t always recompile whenever I tab to the browser, and then evaluating blocks or running “Load file in REPL” from intelliJ
sounds good to me. maybe you just pressed switch-to-current-ns before load-file-in-repl?
switching itself doesn't load anything so you must either load-file or require first
note that the :did-not-find
is a placeholder. I need to check what the standard CLJS REPL does in this place.
:autobuild false
doesn't recompile on file change but the file change still invalidates the file so that it will be recompiled
then I run load file in REPL
, it appears to work — Loading cljs/src/spark_web/views/feedback.cljs... done
minutes, I mean it never works again, the only way I can use the ns again seems to be starting a new process
is there a different way (other than watch
) to compile such that the browser will connect to the shadow server for a REPL?
I should also try with a fresh project to make sure it wasn’t anything to do with my particular build
so in a minimal example I am finding more reliable behaviour. maybe it also has something to do with how much time it takes to reload larger namespaces with a lot of dependencies? or could multiple changes trigger overlapping/interfering processes?
at some point in my small example I also saw things like this;
no source by id: [:shadow.build.classpath/resource "shadow_ex/core.cljs"]
{:id [:shadow.build.classpath/resource "shadow_ex/core.cljs"]}
ExceptionInfo: no source by id: [:shadow.build.classpath/resource "shadow_ex/core.cljs"]
clojure.core/ex-info (core.clj:4739)
clojure.core/ex-info (core.clj:4739)
shadow.build.data/get-source-by-id (data.clj:147)
shadow.build.data/get-source-by-id (data.clj:144)
shadow.build.compiler/remove-dead-js-deps/remove-fn--14770/fn--14771 (compiler.clj:873)
clojure.core/complement/fn--5391 (core.clj:1433)
clojure.core/filter/fn--5614 (core.clj:2809)
clojure.lang.LazySeq.sval (LazySeq.java:40)
it autobuild is off it'll have reset (meaning removed) a bunch of resources from the compiler state which compile
usually adds in again
or maybe just remember to invalidate them but only do so before the next actual compile is triggered
also, not sure if this is already covered, but following a :did-not-find ...
error, a few seconds later a REPL command timed out.
message shows up
might have expected that the :did-not-find
would cause the command to stop/fail immediately?
@thheller I agree with you, I believe this is being caused by classpath conflicts as I am getting many and noticed the closure compiler is from 2017
So I think the version being used is faulty
of the libraries not shadow
@mhuebert nah the :did-not-find
thing is really just a placeholder because I was undecided on how to deal with the situation. wanted to check what CLJS did but somehow forgot about it.
@flyboarder I'm confused. I thought compilation worked fine but you were getting errors at runtime?
I am it compiles without issues, but I suspect the version being pulled in is old
so did you verify that app
has the properties you expect it to have? that is the first and only question you should answer.
just ran into a super weird issue trying to require auth0-js@latest. the minified version throws an error Cannot read property 'lib' of undefined
when shadow requires it — partway into the file, a variable is undefined when it shouldn’t be. I can require the unminified version without any issues, so I guess it’s something to do with their minification
uhm I only get that when I require it in the REPL? inside a normal build it seems to work?
it might be closure just getting confused by the code. it might be my JS processing. no clue what is happening
core = createCommonjsModule(function(module, exports) {
var CryptoJS;
module.exports = ((CryptoJS =
CryptoJS ||
(function(Math, undefined) {
var create =
Object.create ||
(function() {
function F() {}
return function(obj) {
var subtype;
return (
(F.prototype = obj),
(subtype = new F()),
(F.prototype = null),
subtype
);
};
})();
undefined = {};
var C_lib = (undefined.lib = {}),
Base = (C_lib.Base = {
extend: function(overrides) {
I guess its time to investigate this some more https://github.com/thheller/shadow-cljs/issues/173 😉
I wondered if maybe there were collisions with global vars, as I’ve run into that a bunch of times when mixing cljs code with other projects
there is an actual function definition that uses undefined as a binding name function(Math, undefined) {
I'm surprised that undefined
is even a legal binding name but this is JS so I expect nothing less I guess
need to see if I can reproduce this with just closure. looks like a bug on their end
question, do I understand correctly that a top level :clojure-defines
in a build will be used for both :dev
and :release
?
cool thanks!
@mhuebert gotta love the JS world. you can temporarily fix it by setting :js-options {:variable-renaming :local}
I disabled variable-renaming by default to fix an issue in another library and making debugging a bit easier in general
with variable renaming closure will change the function signature to function(a,b) {
so the undefined
is gone and nothing left to get confused about
no idea why the non minified version doesn't have this issue. Maybe another function wrapper is added or so that makes it go boom
/**
* CryptoJS core components.
*/
var CryptoJS = CryptoJS || (function (Math, undefined) {
can't reproduce it with standard compiler since it doesn't allow turning variable renaming off
Anyone know how I can have shadow pass this arg to clojure -Sdeps '{:mvn/local-repo ".m2/repository"}'
or do you use deps.edn
and want it to use that? then there is no way other than calling clj -Sdeps '{:mvn/local-repo ".m2/repository"}' shadow.cljs.devtools.cli release app
There are a couple of issues here tbh. Are you talking about an issue regarding not being able to pass args to clj