clojurescript

Mohit Bhalsod 2025-07-04T03:33:26.530399Z

Hi all, I am new to clojrue and clojurescript. I am trying to setup a SPA web app using helix, shandow-cljs & deps.edn. but when I try to run the app I am getting following error. I am using the latest version of clojure (1.12.1.1550) and clojurescript (1.12.42). I am using vscode with Calva REPL.

File: jar:file:/home/user/.m2/repository/org/clojure/clojurescript/1.12.42/clojurescript-1.12.42.jar!/cljs/pprint.cljs:9:1
--------------------------------------------------------------------------------
   6 | ;   the terms of this license.
   7 | ;   You must not remove this notice, or any other, from this software.
   8 | 
   9 | (ns cljs.pprint
-------^------------------------------------------------------------------------
Invalid :refer, var cljs.core/IWriter does not exist
--------------------------------------------------------------------------------
  10 |   (:refer-clojure :exclude [deftype print println pr prn float?])
  11 |   (:require-macros
  12 |     [cljs.pprint :as m :refer [with-pretty-writer getf setf deftype
  13 |                                pprint-logical-block print-length-loop
--------------------------------------------------------------------------------

thheller 2025-07-04T07:19:00.574069Z

that is odd. that var most definitely exists. I suspect something weird in your classpath and a rogue cljs.core ns hiding somewhere?

p-himik 2025-07-04T09:18:00.889329Z

Could it be due to the compilation output dir being on the classpath?

thheller 2025-07-04T09:27:48.929739Z

I have checks for that, so doubtful

Mohit Bhalsod 2025-07-05T11:02:12.079359Z

Thank you guys for the reply, I fixed the issue, I had a created cljs/core.cljs file in directory inside src. when I renamed it to app.cljs it started working. But I didn't understand why that was the issue.

thheller 2025-07-05T11:57:29.169479Z

namespaces are supposed to be unique. so you effectively overwrote the cljs.core that comes with cljs. best to pick a unique enough prefix. anyhing cljs.* should be considered reserved

Mohit Bhalsod 2025-07-05T12:00:34.000819Z

I see

Mohit Bhalsod 2025-07-05T12:02:54.937249Z

another issue I am facing (and have faced randomly in past) is that the vs code calva extension is stuck when waiting for shadow-cljs to complete even after shado-cljs has compiled.

Mohit Bhalsod 2025-07-05T12:03:53.119949Z

Stuck here

thheller 2025-07-05T12:05:12.680939Z

well did you open your app in the browser? or whatever you are targetting?

Mohit Bhalsod 2025-07-05T12:07:02.967259Z

yes, I did now but that didn't help. let me jack-in again.

thheller 2025-07-05T12:07:32.255659Z

look at the browser console. there should be a "shadow-cljs ready" message

Mohit Bhalsod 2025-07-05T13:19:54.553119Z

Now after restarting vscode. I am getting this error:

ExceptionInfo: already started

p-himik 2025-07-05T13:21:01.226999Z

Seems like exiting (killing?) VSCode did not stop the original shadow-cljs process. Try killing all related processes via your task manager, whatever it might be.

Mohit Bhalsod 2025-07-05T13:22:54.414519Z

yes right, I had same thought, I killed all running clojure process. now it the calva started processing.

Mohit Bhalsod 2025-07-05T13:26:57.880419Z

Finally it's working now. There were 2 issues, 1. I had wrong path of js file in index.html and 2. I was not opening the app in the browser, which is why the jack-in was not completing. Thank you guys for your help.