figwheel-main

figwheel-main http://figwheel.org
2020-06-02T03:25:54.126300Z

I’ve been spending the past few hours trying to debug where this is coming from:

Uncaught TypeError: Cannot read property 'unstable_cancelCallback' of undefined
As far as I can tell it’s to do with react and react-dom versions, being incompatible, even though they’re currently exactly the same. This seems rather fiddly and exceedingly fragile. I’m also a little worried that the difficultly of this process is making me even more unwilling to update libs when it should be the other way around? I’ll try and see if I can pick this up tomorrow…

2020-06-02T10:22:02.126800Z

[Figwheel] Failed to compile build prod in 0.025 seconds.
[Figwheel:WARNING] Compile Exception: contains? not supported on type: java.lang.Boolean  
[Figwheel:SEVERE] contains? not supported on type: java.lang.Boolean
Execution error (IllegalArgumentException) at cljs.closure/compute-upstream-npm-deps$fn (closure.clj:2440).
contains? not supported on type: java.lang.Boolean
I get this when trying to build with :target :bundle ?

2020-06-02T10:36:18.127400Z

Yes, update clojurescript to 1.10.773 should help =)…

bhauman 2020-06-02T12:26:12.128Z

@didibus ^

ingesol 2020-06-02T13:04:52.129500Z

Hm, I’m using 0.2.7 and building with auto-test, seems auto-test is overwriting the regular main.js:

[Figwheel] Successfully compiled build basedev to "resources/public/js/main.out/index.js" in 42.267 seconds.
[Figwheel] Bundling: npx webpack --mode=development resources/public/js/main.out/index.js -o resources/public/js/main.js
[Figwheel] Outputting main file: resources/public/js/main.out/index-auto-testing.js
[Figwheel] Bundling: npx webpack --mode=development resources/public/js/main.out/index-auto-testing.js -o resources/public/js/main.js
[Figwheel] Watching paths: ("src/clojure" "test/clojure") to compile build - basedev

bhauman 2020-06-02T13:16:26.130Z

@ingesol what are your compiler options?

ingesol 2020-06-02T13:20:35.130400Z

@bhauman

{:main            my.main
 :output-to       "resources/public/js/main.out/index.js"
 :auto-testing    true
 :output-dir      "resources/public/js/main.out",
 :asset-path      "/js/main.out"
 :closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}
 :preloads        [my.preloads]}

ingesol 2020-06-02T13:21:07.130900Z

figwheel-main.edn

{:auto-testing       true
 :watch-dirs         ["src/clojure" "test/clojure"],
 :css-dirs           ["resources/public/css"],
 :open-url           "false"
 :helpful-classpaths false
 :auto-bundle        :webpack
 :final-output-to    "resources/public/js/main.js"}

bhauman 2020-06-02T13:21:50.131400Z

well that’s a bug then

ingesol 2020-06-02T13:22:10.132200Z

could it be the specification of :final-output-to?

bhauman 2020-06-02T13:22:33.132700Z

no it’s a bug I must have introduced recently

bhauman 2020-06-02T13:23:01.133100Z

final-output-to is supposed to be munged

ingesol 2020-06-02T13:23:22.133500Z

I THINK I tested this with both auto-test and in main somewhere on 0.2.7-SNAPSHOT

bhauman 2020-06-02T13:25:48.133800Z

I refactored

bhauman 2020-06-02T13:25:52.134Z

so

bhauman 2020-06-02T13:26:02.134300Z

probably missed something

ingesol 2020-06-02T13:37:20.134900Z

Well, logging is really to the point so was easy to spot what’s wrong with the output

bhauman 2020-06-02T13:38:20.135100Z

yep I found the bug

bhauman 2020-06-02T13:38:23.135300Z

thanks

1👍
ingesol 2020-06-02T13:42:18.135800Z

Let me know if you want me to retest snapshot

bhauman 2020-06-02T13:43:54.135900Z

yes you probably have more exclusions to do

bhauman 2020-06-02T13:44:19.136100Z

clojure -Stree will tell you if you are pulling in react or react-dom

bhauman 2020-06-02T13:44:45.136300Z

also added some infor to cljs-ajax here https://github.com/JulianBirch/cljs-ajax/issues/247

bhauman 2020-06-02T14:07:02.137Z

@ingesol 0.2.8-SNAPSHOT

ingesol 2020-06-02T14:10:18.137300Z

confirmed 🙂

ingesol 2020-06-02T14:11:36.137600Z

both main app and auto-test page works onw

bhauman 2020-06-02T14:12:41.138Z

great 👍

bhauman 2020-06-02T14:20:04.138700Z

but until this https://clojure.atlassian.net/browse/CLJS-3258 is fixed its going to be hard to have cljsjs libs in :bundle

bhauman 2020-06-02T14:21:06.139500Z

Also I want to point out a CLJS issue to keep an eye on

bhauman 2020-06-02T14:21:07.139700Z

https://clojure.atlassian.net/browse/CLJS-3258

2020-06-02T15:46:42.139800Z

I use deps.edn in new projects, but the code I’m currently in is an old one so it’s all lein based, I’m trying to work out if there’s a lein equivalent to clj -m cljs.main --install-deps --open-url false as calling that without a deps.edn just crashes… Although thinking about it perhaps it’s best to establish that this works before porting everything…

bhauman 2020-06-02T15:50:08.140Z

you can call lein run -m figwheel.main -- --install-deps

1😍
2020-06-02T16:11:29.140300Z

Ok, for the first time it has worked!

1🎉
2020-06-02T16:11:54.140600Z

Now to see how reproducible it is…

bhauman 2020-06-02T17:38:32.140800Z

WOW!

1😄
2020-06-02T17:38:52.141Z

I’ve made some notes as I went, so far it’s looking good, do you want them? If not I’ll probably put together a quick blog post…

2020-06-02T17:39:07.141200Z

That was 5 days by my count :P…

2020-06-02T17:44:28.141500Z

Ok, perhaps spoke too soon, looks like it doesn’t like optimisations advanced…

2020-06-02T18:02:38.141700Z

Fixed that, let’s see if it works =)…

2020-06-02T18:10:19.141900Z

Done! Looks a bit more complicated than before, but manageable I think, and hopefully when that bug gets fixed it will become simpler again =)…

1👍
2020-06-02T18:51:39.142200Z

That's the version I am using

2020-06-02T18:52:22.142400Z

Along with fighweel "0.2.7"

2020-06-02T19:00:21.142600Z

Seems to be caused by me having :install-deps true in my config

2020-06-02T19:00:49.142800Z

:clojure.main/message
 "Execution error (IllegalArgumentException) at cljs.closure/compute-upstream-npm-deps$fn (closure.clj:2440).\ncontains? not supported on type: java.lang.Boolean\n",
 :clojure.main/triage
 {:clojure.error/class java.lang.IllegalArgumentException,
  :clojure.error/line 2440,
  :clojure.error/cause
  "contains? not supported on type: java.lang.Boolean",
  :clojure.error/symbol cljs.closure/compute-upstream-npm-deps$fn,
  :clojure.error/source "closure.clj",
  :clojure.error/phase :execution}

2020-06-02T19:23:00.143Z

Check your deps tree? you might be running a different version than you think you are… (I’ve done this..) With deps.edn it’s clj -Stree and with lein it’s lein deps :tree

2020-06-02T19:38:30.143300Z

Hum, checked -Stree, still shows org.clojure/clojurescript 1.10.773

bhauman 2020-06-02T20:12:51.143500Z

@didibus it really shouldn’t be happening with that version

2020-06-02T20:15:11.143800Z

Hum, something else that happens is that it doesn't se to apply the bundle-cmd after the build

2020-06-02T20:15:20.144Z

I have to manually run it

bhauman 2020-06-02T20:18:13.144200Z

Thanks for hanging in there

2020-06-02T22:13:53.144400Z

No problem =)…

2020-06-02T22:14:21.144600Z

Thanks for all the help ^_^…