Ok. I am using React Native and Expo with an iOS simulator. I got the IP addresses to line up and disabled fast refresh on the simulator. When I refresh my code the simulator displays the new set up immediately, then reloads the previous state. What am I doing wrong?
probably still have the expo reload active
It says disabled on the simulator pop-up...
sorry I don't use react-native or expo and it has been a couple years since I tested this. there used to be a separate expo reload. no clue if that still exists. I cannot help you track this down but if you see two reloads then this is the most likely cause.
Ok, thanks for the lead!
Hey all! I recently just updated my shadow version on a project (from 2.8 to 2.11) and am now seeing a "Failed to inspect file <path>.css" - it's coming from a JS file that is built and imports a CSS file via require. I would expect this issue https://github.com/thheller/shadow-cljs/issues/598 to have solved this, but maybe I'm missing something. I also kinda remember an ignore-resources
option existing once, but I'm not sure if I'm misremembering
Any tips on how to best resolve this?
(Also, interestingly, the same application compiles fine under 2.8)
@rschmukler the default changed from ignoring asset css requires to failing them so they don't go unnoticed. you can set :js-options {:ignore-asset-requires true}
to get the old behaviour
Wonderful, thank you for the help! Is this potentially worth documenting in the user-guide? I will add a comment to that issue as well
Having a problem with inspect - my taps are not showing up in the Inspect stream. I have devtools.preload
in the :preloads
. Has something changed?
devtools.preload
? that is not from shadow-cljs or related to inspect
I'm sure the tap>
s are getting executed because I have console logging on the same code path
And yea, it does say stuff like shadow-cljs: #21 ready!
in the console also.
I just tried executing tap via browser-repl
, and those values do show up
do you maybe tap>
too early? like on page load?
hmm yea it is pretty quick, I'll try delaying it
the tap> is only setup after the ready
message so if you log before that it won't make it to the UI
yea, that was it
Can my program listen for the ready message?
no, not currently
Would you accept a PR to have the shadow tap listener queue messages until the page is ready, then flush?
if you do it in a clean way. the way this is currently set up this isn't easily possible.
Ok, I may give this a shot. Thanks for the help!
doesn't require any config actually, it is on by default with watch
builds
I am watching my source files using Hawk. Ordinarily, when I hit save, I get 1 :modify event as expected. However, when running Shadow in watch mode, saving a single file results suddenly in all that io:
:hawk :create #object[java.io.File 0x18f77246 /home/adam/projects/clj/helins/medium/src/dev/helins/medium/4913]
:hawk :modify #object[java.io.File 0x52954b80 /home/adam/projects/clj/helins/medium/src/dev/helins/medium/4913]
:hawk :delete #object[java.io.File 0x58038f69 /home/adam/projects/clj/helins/medium/src/dev/helins/medium/4913]
:hawk :delete #object[java.io.File 0x7f50d4a /home/adam/projects/clj/helins/medium/src/dev/helins/medium/dev.cljc]
:hawk :create #object[java.io.File 0x43e0fe21 /home/adam/projects/clj/helins/medium/src/dev/helins/medium/dev.cljc~]
:hawk :create #object[java.io.File 0x393148d /home/adam/projects/clj/helins/medium/src/dev/helins/medium/dev.cljc]
:hawk :modify #object[java.io.File 0x3fffaee3 /home/adam/projects/clj/helins/medium/src/dev/helins/medium/dev.cljc]
:hawk :delete #object[java.io.File 0x4b70ec0a /home/adam/projects/clj/helins/medium/src/dev/helins/medium/dev.cljc~]
Is that normal?shadow is just watching. it never modifies your source files ever, it only reads. the events happening are done by you
likely your editor
Hmmm, weird, I get that behavior only when Shadow is running (same editor and all...)
But yeah, I was surprised at the idea it might modify anything in the source
Ah, that is the console.log formatter, never mind. But yea sounds like I should be seeing taps, but I'm not seeing any.
check the browser console if its connected properly
don't know what you are doing so really can't help much. try shadow-cljs browser-repl
or shadow-cljs node-repl
and see if those show up
i'm attempting to startup up a :deps true
style project with CIDER. I'm getting the dreaded "missing instance". I remember reading in the users guide (although i can no longer find it) that if i made sure ensure that shadow's middleware was included all would be good. I'm attempting:
/usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/piggieback {:mvn/version "0.5.2"} cider/cider-nrepl {:mvn/version "0.25.8"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[\"cider.nrepl/cider-middleware\",\"shadow.cljs.devtools.server.nrepl/middleware\",\"cider.piggieback/wrap-cljs-repl\"]"]}}}' -M:test:cider/nrepl
and then
(do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :app) (shadow/nrepl-select :app))
after startup and i'm still getting the missing intance message. Is there something i'm skipping over?piggieback is not necessary but cider still sticks it in when doing clojurescript
ah i'm sorry. I've found (and documented before) that i need to call (shadow.cljs.devtools.server/start!)
@dpsutton yeah missing instance always means that shadow-cljs has not been started in the JVM you are connected to. which won't happen if you just start an nrepl server like the command above.
the strange thing is i had npx shadow-cljs server
which includes :nrepl {:port 8701}
. My understanding is that it would have been the server
yes, that is the server but you don't seem to be connected to it
the above commands starts its own nrepl server in a new JVM which cider then probably connects to
if you want to do it absolutely correctly and the way it is intended then DO NOT configure a fixed :nrepl
port and instead look up the port in .shadow-cljs/nrepl.port
or rather teach cider how to do that 😛
still no clue how cider works or does
haha. i know more about it than only 2 or 3 people and i'm still working it out 🙂 Trying to figure out how to setup <https://logseq.com/>
for local dev
Hello, I use emacs/cider and have a clojurescript project build with shadow cljs. I connected to the nrepl server, but I'm not able to send s-expressions to the repl with C-c C-e
like I normally do. Can someone here me with this?
wanna chat in #cider for the time being? Most likely an issue with setup and not actually shadow
hopefully that makes it clearer in the future https://github.com/thheller/shadow-cljs/commit/c7c831e19851ff4ef1fa4967abb60b469fc76b98
Okay, I already raised the question in #cider 🙂
should I delete this thread?
nah. its a single comment and if anyone has a similar issue maybe they'll be directed to #cider
lovely
hi there—think im running into a user error here when trying to override config from the repl. ive been trying to walk this path:
(shadow/compile
:build1
{:config-merge
{:closure-defines '{<http://my.app/SOMETHING|my.app/SOMETHING> true}}})
and i must be getting something slightly off because it gives the error that the structures can't be merged. the exception makes it look like the structure is a seq
of map entries rather than a map potentially? sincere apologies if ive missed something in the manual that addresses this use-casei actually think the solution im aiming for will eliminate the need to do this, but in general this seemed like something someone might want to do