This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-13
Channels
- # aleph (6)
- # architecture (29)
- # beginners (175)
- # cider (22)
- # clara (5)
- # cljdoc (5)
- # cljs-dev (28)
- # cljsrn (6)
- # clojure (62)
- # clojure-finland (7)
- # clojure-italy (7)
- # clojure-nl (2)
- # clojure-spec (23)
- # clojure-uk (194)
- # clojurescript (90)
- # core-async (2)
- # cursive (23)
- # datomic (41)
- # defnpodcast (2)
- # editors (4)
- # emacs (1)
- # figwheel-main (41)
- # fulcro (53)
- # hoplon (15)
- # hyperfiddle (4)
- # immutant (1)
- # jobs (7)
- # jobs-discuss (103)
- # lein-figwheel (9)
- # off-topic (34)
- # onyx (3)
- # parinfer (1)
- # portkey (1)
- # re-frame (7)
- # reagent (2)
- # remote-jobs (2)
- # rum (1)
- # shadow-cljs (148)
- # sql (54)
- # tools-deps (3)
- # vim (7)
OK now I'm looking into the Cannot find module '@cljs-oss/module-deps'
problem that crops up when you add or remove dependencies while using global-exports
This also seems to lead to a race which prevents the global-export from binding to its munged name.
@bhauman How does it happen that the (enable-console-print!) is no longer needed to print to the console using println?
figwheel provides https://figwheel.org/config-options#client-print-to to determine where you want prints to go to
Well my question is slightly different. I remembered from official Clojurescript articles that enable-console-print is needed to enable printing to the js console using println. Now with the newest clojure after successful compilation I can still println to the console without enable-console-print!
. That's nice! But question is why?
I thought it's obligatory to have it
OK its because figwheel has to make prints go to the REPL, so it has to change the *print-fn*
and if it has to change the *print-fn*
it might as well make prints go to the console as well because we are in development mode when we use figwheel.
Well sorry I was not accurate. I compiled the program with the cljsbuild. When I run the compiled program with node then the prints go to the console even if the enable-console-print! is not used. How does it happens? I remember that in the past it was not possible
I will try my luck on #clojurescript
mfikes [3:23 PM]
@Karol W贸jcik It was 1.10.238 (`*print-fn*` automatically set): (edited)
So maybe let's point in the README.md that starting from the 1.10.238 to ensure the correct behaviour in figwheel-main the user should avoid manually setting the enable-console-print because the print-fn is automatically set to js/console. What do you think @bhauman? I can prepare PR if you want 馃檪Was just experimenting with figwheel-main. Haven't gotten a chance to condense for minimal reproduction yet, but just a heads up.... Was getting "[Figwheel] Compile Exception: Don't know how to write JSON of class java.io.File" errors when Figwheel reloaded after cljs change. Didn't find any additional info in the logs. Added clojure.pprint/pprint (Throwable->map e))
at https://github.com/bhauman/figwheel-main/blob/3fbeb0c/src/figwheel/main.cljc#L91 to see full stack trace. Cause was at https://github.com/bhauman/figwheel-core/blob/77bf8be/src/figwheel/core.cljc#L670 . The warning-infos contain a Java.io.File instance. So I think it will bomb attempting to reload whenever there are compiler warnings (which of course should be resolved anyway).
e.g.
({:warning-type :single-segment-namespace,
:line 1,
:column 1,
:ns cljs.user,
:extra {:name dev},
:message "dev is a single segment namespace",
:file #object[java.io.File 0x3aa869be "devsrc/dev.cljs"],
:file-excerpt
{:start-line 1,
:excerpt
(apply figwheel.main.api/start (concat [{:open-url false
:watch-dirs ["src" "devsrc"]
;:css-dirs ["../app/assets/stylesheets" "resources/public/admin/css"]
:css-dirs []
:target-dir "resources"
:log-file "figwheel-main.log"
:log-level :debug
:mode :serve}]
configs)))))
I'm getting the same error whether I explicitly set :load-warninged-code
to true or false
My :single-segment-namespace
was one of my :preloads
. Taking it out of :preloads still gave the same "Don't know how to write JSON of class java.io.File" error in the browser, but in that case, it's pretty obvious because the compile warning is in the log output. Everything works as expected if I resolve the warning.
it's nowhere near as straight forward as :http-server-root
but much more configurable
@bhauman Generated a minimal app from clj -A:new figwheel-main figwheel-main.app --reagent
and added a commit to reproduce.