bhauman / figwheel-main

Figwheel Main provides tooling for developing ClojureScript applications
https://figwheel.org
Eclipse Public License 1.0
640 stars 93 forks source link

logger set-up exception at browser start-up #297

Closed gdanov closed 2 years ago

gdanov commented 3 years ago

I'm using latest figwheel-main release with clojurescript excluded in the deps. When I switch from cljs 1.10.866 to git commit :sha "9027c02852bbeb512cda728e5f0551145e921a9c" I get the exception below in the browser upon first page load.

I'm using that specific cljs commit because I'm testing the fix in it.

Uncaught TypeError: logger_SINGLEQUOTE_.setLevel is not a function
    at figwheel$repl$logging$set_log_level (logging.cljs:63)
    at figwheel$repl$init_log_level_BANG_ (repl.cljc:601)
    at figwheel$repl$connect_STAR_ (repl.cljc:604)
    at repl.cljc:613
    at Function.cljs$core$IFn$_invoke$arity$variadic (repl.cljc:613)
    at figwheel$repl$connect (repl.cljc:611)
    at preload.cljs:5
figwheel$repl$logging$set_log_level @ logging.cljs:63
figwheel$repl$init_log_level_BANG_ @ repl.cljc:601
figwheel$repl$connect_STAR_ @ repl.cljc:604
(anonymous) @ repl.cljc:613
(anonymous) @ repl.cljc:613
figwheel$repl$connect @ repl.cljc:611
(anonymous) @ preload.cljs:5
load (async)
(anonymous) @ preload.cljs:5
jleonard-r7 commented 3 years ago

I'm also seeing this.

athomasoriginal commented 2 years ago

on version: 1.10.891 I am running into a similar errors described above. This is a screen cap from Safari, but the issue exists in general:

Screen Shot 2021-11-04 at 7 56 02 PM

No errors on 1.10.879

henryw374 commented 2 years ago

based on this demo, https://github.com/google/closure-library/blob/master/closure/goog/demos/debug.html it looks like goog.log is what it should be moved to

bhauman commented 2 years ago

So there were breaking changes in the goog.log library introduced in recent versions of the google closure compiler which translates to breaking changes in clojurescript. So if you roll the clojurescript version back you unfortunately need to roll figwheel back as well which is a pain I realize. The other solution would be for figwheel-main to abstract log calls and detect which api is in use on loading. There have been several different breaking changes to logging over the last few years.

henryw374 commented 2 years ago

With the current versions of figwheel and clojurescript I see a bunch of logging errors - which stops figwheel working. It may not be exactly the issue as was raised here but obviously related

bhauman commented 2 years ago

Yep that checks out. Man I should never have used google closures logging system. They change it way too often, I'm going to just strip it out that way there are no backwards compatibility problems. But for now I'm going to fix the current problem.

bhauman commented 2 years ago

Alrighty, I just deployed 0.2.15-SNAPSHOT and it should address all of the above issues.

Let me know if it is working for you.

Be sure to clean your compiled cljs files before checking testing it :)

Thanks all!

henryw374 commented 2 years ago

thanks. still seeing error thrown from https://github.com/bhauman/figwheel-core/blob/master/src/figwheel/core.cljc#L112

looks like name cannot be nil

athomasoriginal commented 2 years ago

Just a little more context: 0.2.15-SNAPSHOT + CLJS 1.10.891

Screen Shot 2021-11-10 at 9 42 06 AM
bhauman commented 2 years ago

thanks! I guess my last commit didn't make it into the release

bhauman commented 2 years ago

Just re-deployed the SNAPSHOT. Sorry for the lost cycles.

athomasoriginal commented 2 years ago

Did it make it out? I deleted my ~/.m2 of 0.2.15-SNAPSHOT to be sure and still seeing similar issues. 🤔

bhauman commented 2 years ago

Really I'm using it locally just fine

bhauman commented 2 years ago

did you clean your compiled artifacts? or is your cljs caching enabled?

athomasoriginal commented 2 years ago

At this point, I've also deleted everything in the target dir and cleared cache/hard refreshed browsers (all 3 + using incognito). The nm error is gone now (win!) during compilation, but the browser console errors I get are:

Chrome

Screen Shot 2021-11-10 at 8 00 02 PM

Firefox

Screen Shot 2021-11-10 at 8 00 47 PM Screen Shot 2021-11-10 at 8 01 16 PM
bhauman commented 2 years ago

This is very strange. These to look like the Javascript errors that would result from the missing 'nm' error.

bhauman commented 2 years ago

Do you have :aot-cache set to true?

bhauman commented 2 years ago

I just deleted my .m2 as well and launched a project generated by the figwheel-main-template and it all seems to work with the jars pulled down from clojars.

henryw374 commented 2 years ago

latest snapshot working for me. Thanks!

athomasoriginal commented 2 years ago

Works, Bruce!! Thanks again and apologies for the gas lighting! What worked for me:

Appreciate you ❤️

bhauman commented 2 years ago

just deployed 0.2.15 with these fixes