Calva: Calva + shadow.cljs throws an error when hot reload in some cases

Created on 15 Jun 2018  Â·  6Comments  Â·  Source: BetterThanTomorrow/calva

Hi. Thank you for calva, it's awesome.

I found a very weird bug. In some cases when we run server or watch task in shadow-cljs, start the browser and only then connect calva to the nRepl, browser console throws the error every time we hot reload the code.

Here the steps to reproduce:

  1. Clone this repo https://github.com/quangv/shadow-re-frame-simple-example
  2. npm install or yarn
  3. npx shadow-cljs watch app
  4. open the http://localhost:8020 page, open the console
  5. open the project in VS Studio, connect it to the app build
  6. change anything in the code

expected result: console is clear
actual result: the error in the browser console

env.cljs:114 Uncaught TypeError: Cannot read property 'cljs$core$IFn$_invoke$arity$1' of null
    at core.cljs:4199
    at Object.cljs$core$some [as some] (core.cljs:4199)
    at browser.cljs:205
    at Function.G__24106__1 [as cljs$core$IFn$_invoke$arity$1] (core.cljs:4222)
    at core.cljs:5120
    at cljs.core.filter.cljs$core$IFn$_invoke$arity$2 (core.cljs:5120)
    at cljs.core.LazySeq.sval (core.cljs:3394)
    at cljs.core.LazySeq.cljs$core$ISeqable$_seq$arity$1 (core.cljs:3448)
    at Object.cljs$core$seq [as seq] (core.cljs:1210)
    at Function.cljs.core.seq_reduce.cljs$core$IFn$_invoke$arity$3 (core.cljs:2445)

The same error happens every time shadow-cljs reloads the code

If we first do 5 and then 4 - everything works fine.

I also tried the same steps in Emacs Cider and it works perfectly fine there.

Most helpful comment

Hi @PEZ

Sorry for late response, but yes, this is still an issue:
screen shot 2018-08-17 at 08 20 51

All 6 comments

Hello, sorry for late response! This sounds like a hard to track down problem. What version of Shadow-cljs are you using?

I wonder what Cider does differently… Will check out.

@PEZ version 2.4.5

Still having this issue, @denistakeda ? Sorry again, I dropped this ball.

Hi @PEZ

Sorry for late response, but yes, this is still an issue:
screen shot 2018-08-17 at 08 20 51

I get exactly the same error with shadow-cljs when I use JS files and they contain imports to my own JS files - so I doubt it's related to Calva directly.

I've repeated the repro steps as described and did not experience this error. Perhaps whatever the cause, it has been fixed. Going to close this now, but please reopen if the problem persists for you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

svdo picture svdo  Â·  4Comments

dijonkitchen picture dijonkitchen  Â·  6Comments

PEZ picture PEZ  Â·  3Comments

frantic picture frantic  Â·  5Comments

frankadrian314159 picture frankadrian314159  Â·  4Comments