shadow-cljs 2025-10-16

Hey everyone. Having an issue with REPL ” corruption” after crash: can’t create new namespaces with requires. I’m running into a persistent issue after my REPL crashed while printing lots of JavaScript data via println. Now I can’t create any new namespaces that require other namespaces. *The Problem:* - New simple namespaces compile at first - But if I add :require to other namespaces and restart REPL, they fail to compile - Even empty namespaces with just ns + require fail, while the required namespaces themselves work fine - Cleaning cache doesn’t help (`rm -rf .shadow-cljs target`) *Example:* This works:

(ns erv.otra-cosa.b)
(def a 1)
This fails after REPL restart:
(ns erv.otra-cosa.b
  (:require [taoensso.timbre :as timbre]))

(def a 1)
The repl logs are these (since the start of the session).
[:browser-test] Configuring build. [:browser-test] Compiling ... [:browser-test] Build completed. (181 files, 2 compiled, 1 warnings, 8.19s) To quit, type: :cljs/quit ------ WARNING #1 - :redef ----------------------------------------------------- Resource: com/gfredericks/exact.cljc:130:1 ;; => [:selected :browser-test]-------------------------------------------------------------------------------- 127 | {:pre [(pos? n)]} 128 | (impl/rem x n)) 129 | 130 | (defn abs -------^------------------------------------------------------------------------ abs already refers to: cljs.core/abs being replaced by: com.gfredericks.exact/abs -------------------------------------------------------------------------------- 131 | [x] 132 | (cond-> x (neg? x) (-))) 133 | 134 | (defn even? -------------------------------------------------------------------------------- WARNING: abs already refers to: #'clojure.core/abs in namespace: taoensso.encore, being replaced by: #'taoensso.encore/abs WARNING: update-keys already refers to: #'clojure.core/update-keys in namespace: io.aviso.exception, being replaced by: #'io.aviso.exception/update-keys ------ WARNING - :redef -------------------------------------------------------- Resource: <eval>9151 abs already refers to: cljs.core/abs being replaced by: taoensso.encore/abs -------------------------------------------------------------------------------- Execution error (TypeError) at (<cljs repl>:1). Cannot read properties of undefined (reading 'b')
The browser console logs this:
shared.cljs:151 REPL Invoke Exception TypeError: Cannot read properties of undefined (reading 'b') at eval (eval at shadow$cljs$devtools$client$browser$global_eval (shadow.cljs.devtools.client.browser.js:1:1), <anonymous>215) at eval (eval at shadow$cljs$devtools$client$browser$global_eval (shadow.cljs.devtools.client.browser.js:1:1), <anonymous>31063) at eval (<anonymous>) at Object.shadow$cljs$devtools$client$browser$global_eval [as global_eval] (browser.cljs:159:5) at Object.eval [as shadow$cljs$devtools$client$shared$IHostSpecific$do_invoke$arity$5] (browser.cljs:208:19) at Object.shadow$cljs$devtools$client$shared$do_invoke [as do_invoke] (shared.cljs:23:15) at shadow$cljs$devtools$client$shared$handle_repl_invoke (shared.cljs:133:4) at Object.shadow$cljs$devtools$client$shared$interpret_action [as interpret_action] (shared.cljs:208:12) at shadow$cljs$devtools$client$shared$interpret_actions (shared.cljs:233:8) at Object.shadow$cljs$devtools$client$shared$continue_BANG_ [as continue_BANG_] (shared.cljs:105:4) shadow$cljs$devtools$client$shared$handle_repl_invoke_$replinvoke_fail @ shared.cljs:151 eval @ browser.cljs:210 shadow$cljs$devtools$client$shared$do_invoke @ shared.cljs:23 shadow$cljs$devtools$client$shared$handle_repl_invoke @ shared.cljs:133 shadow$cljs$devtools$client$shared$interpret_action @ shared.cljs:208 shadow$cljs$devtools$client$shared$interpret_actions @ shared.cljs:233 shadow$cljs$devtools$client$shared$continue_BANG_ @ shared.cljs:105 eval @ shared.cljs:162 eval @ browser.cljs:221 eval @ shared.cljs:32 shadow$remote$runtime$shared$process @ shared.cljc:188 eval @ shared.cljs:317 shadow$cljs$devtools$client$shared$remote_msg @ shared.cljs:16 eval @ websocket.cljs:19``` I’ve tried the usual cache cleaning (and even restaring the computer) but the issue persists. Has anyone seen something like this before? Could the REPL crash have corrupted some internal state that survives cache clears? Any suggestions for what else to try would be greatly appreciated! 🙏 --- My repo is an OSS project so here’s a link it’s of any use: (current branch) https://github.com/diegovdc/erv/tree/js-rationals

no. it'll only ignore the warnings for the dev stuff. you are supposed to fix warnings, not ignore them though. 😉

Thanks, could this affect my build in any way?

shadow-cljs defaults to not loading code with warnings in the REPL. from the log I can't see what you are actually doing in the REPL, so I'm guessing its just that? loading something and then trying to use it when its not actually loaded? you can set :devtools {:ignore-warnings true} in the build config so that things get loaded regardless of warnings

This is probably not the best channel to ask, but how should one fix warnings that come from libraries? Forking them? Or is a better way?

if there is no new release available then I guess a fork is in order. or an alternative if available

if the library is small enough, such as the one above you could also just takes the source file and put them into your src folder (or src/main, wherever you keep them)

cool, thanks for the suggestions