This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-14
Channels
- # adventofcode (12)
- # aleph (8)
- # announcements (6)
- # babashka (16)
- # beginners (217)
- # biff (7)
- # calva (30)
- # chlorine-clover (4)
- # cider (3)
- # clj-kondo (15)
- # cljdoc (6)
- # clojure (50)
- # clojure-europe (86)
- # clojure-finland (2)
- # clojure-nl (1)
- # clojure-norway (37)
- # clojure-uk (2)
- # clojurescript (8)
- # cursive (10)
- # datomic (13)
- # emacs (1)
- # fulcro (41)
- # helix (1)
- # humbleui (2)
- # joyride (7)
- # juxt (4)
- # lsp (19)
- # off-topic (47)
- # pathom (14)
- # polylith (5)
- # portal (7)
- # reagent (10)
- # releases (4)
- # sci (1)
- # scittle (18)
- # shadow-cljs (54)
- # test-check (2)
- # tools-deps (28)
I’ve got a bit of a problem operating the CLJS REPL via remote nREPL. When I connect with remote REPL I select the build repl:
Connecting to remote nREPL server...
Clojure 1.11.1
(shadow/nrepl-select :main)
To quit, type: :cljs/quit
=> [:selected :main]
And in this namespace I have imports:
(ns dev-test
(:require [com.fulcrologic.fulcro.data-fetch :as df]
)
But it seems that the requires just don’t work. They work in the app, just not in the REPL:
df/load!
------ WARNING - :undeclared-ns ------------------------------------------------
Resource: <eval>:1:1
No such namespace: df, could not locate df.cljs, df.cljc, or JavaScript source providing "df"
--------------------------------------------------------------------------------
------ WARNING - :undeclared-var -----------------------------------------------
Resource: <eval>:1:1
Use of undeclared Var df/load!
--------------------------------------------------------------------------------
=> nil
::df/id
[line 1, col 8] Invalid keyword: ::df/id.
=> nil
It does work if I write this:
(require '[com.fulcrologic.fulcro.data-fetch :as df])
=> nil
df/load!
=> #object[com$fulcrologic$fulcro$data_fetch$load_BANG_]
What gives?Hm I think it might be the namespace is never loaded
I’ve tried to load the namespace manually but that didn’t work
but that might be a problem with Cursive
Basically to fix it I had to include the NS in require statement of the root app ns
I’ll test this again I think, there might be some other issue at play
I think the problem was that the folder was not part of the CLJS build
Goes like this:
Connecting to remote nREPL server...
Clojure 1.11.1
(shadow/nrepl-select :main)
To quit, type: :cljs/quit
=> [:selected :main]
(in-ns 'roklenarcic.cookery.dev-cli)
=> nil
Loading src/main/roklenarcic/cookery/ui/category.cljs...
------ WARNING - :redef --------------------------------------------------------
Resource: <eval>:33:1
abs already refers to: cljs.core/abs being replaced by: cljc.java-time.duration/abs
--------------------------------------------------------------------------------
config
------ WARNING - :undeclared-var -----------------------------------------------
Resource: <eval>:1:1
Use of undeclared Var /config
--------------------------------------------------------------------------------
=> nil
so in cursive I’ve changed the NS and then loaded the NS
right but the next command loaded it
ah the warning stops the load?
the redef warning
I am triggering the load with CMD+Shift+L in roklenarcic.cookery.dev-cli
but it says
Loading src/main/roklenarcic/cookery/ui/category.cljs...
------ WARNING - :redef --------------------------------------------------------
it’s cursive for load NS of current file
so the category.cljs is required from this one so I am assuming that warning prevent compilation
otherwise you might be starting out at some weird broken state that causes all other weird stuff
I cannot see your code so I don't know what these namespaces are doing. so for me there is a lot of guessing involved which makes every step harder to debug 😛
dev-cli is an empty ns with multiple requires to other namespaces, nothing else at this point
but to be extra clear hear: if you issue an in-ns
WITHOUT the namespace being already loaded that is an ERROR
I think the main problem is that namespace that is required that produces a warning, if I comment that one out then things work as expected
Now I just need to fix
------ WARNING - :redef --------------------------------------------------------
Resource: <eval>:33:1
abs already refers to: cljs.core/abs being replaced by: cljc.java-time.duration/abs
--------------------------------------------------------------------------------
somehowthat’s in a library I use somewhere so I cannot affect the code directly
let’s hope so… thanks