shadow-cljs

Alexis Dumas 2025-05-25T18:46:47.888859Z

Hi, I'm running into a strange error I can't seem to resolve:

(NOBRIDGE) WARN  The shadow-cljs Websocket was disconnected.
 (NOBRIDGE) ERROR  shadow-cljs - remote-error {"isTrusted": false, "message": null}
Error: Unable to resolve module ./app/shadow.cljs.devtools.client.shared from /Users/alexispurslane/Development/yact/mobile/.: 

None of these files exist:
  * app/shadow.cljs.devtools.client.shared(.native.ts|.ts|.native.tsx|.tsx|.native.mjs|.mjs|.native.js|.js|.native.jsx|.jsx|.native.json|.json|.native.cjs|.cjs|.native.scss|.scss|.native.sass|.sass|.native.css|.css)
  * app/shadow.cljs.devtools.client.shared
    at ModuleResolver.resolveDependency (/Users/alexispurslane/Development/yact/mobile/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:114:15)
    at DependencyGraph.resolveDependency (/Users/alexispurslane/Development/yact/mobile/node_modules/metro/src/node-haste/DependencyGraph.js:248:43)
    at /Users/alexispurslane/Development/yact/mobile/node_modules/metro/src/lib/transformHelpers.js:165:21
    at Server._resolveRelativePath (/Users/alexispurslane/Development/yact/mobile/node_modules/metro/src/Server.js:1104:12)
    at Server._explodedSourceMapForBundleOptions (/Users/alexispurslane/Development/yact/mobile/node_modules/metro/src/Server.js:1052:35)
    at async Promise.all (index 1)
    at Server._symbolicate (/Users/alexispurslane/Development/yact/mobile/node_modules/metro/src/Server.js:1009:26)
    at Server._processRequest (/Users/alexispurslane/Development/yact/mobile/node_modules/metro/src/Server.js:419:7)
 (NOBRIDGE) LOG  shadow-cljs #4 ready!
I've tried a few different things, including deleting .shadow-cljs/ and updating shadow-cljs, then updating its version in project.clj, but to no avail

thheller 2025-05-26T05:11:51.710879Z

well. does the file exist? /Users/alexispurslane/Development/yact/mobile/app/shadow.cljs.devtools.client.shared.js?

thheller 2025-05-26T05:12:48.477959Z

dunno why you'd get the disconnect message but then LOG shadow-cljs #4 ready!? this message most definitely wouldn't exist if the shared.js file actually failed to load?

thheller 2025-05-26T05:15:14.350829Z

what is the build config used?

Alexis Dumas 2025-05-29T01:17:21.405159Z

@thheller I figured out the problem

Alexis Dumas 2025-05-29T01:18:12.398519Z

Apparently on Android you need to use adb reverse to port forward, essentially, any ports you want your Android device to be able to access from your development workstation or vice versa

Alexis Dumas 2025-05-29T01:18:26.871929Z

which is odd since its browser can access those ports just fine, but whatever 🤷‍♀️

thheller 2025-05-29T06:25:06.398169Z

good to know

Alexis Dumas 2025-05-26T14:45:09.121409Z

sorry for the delayed reply, I've never used Slack before and I didn't see the thread until just now xD anyway, no, that file does not exist, and neither does the app/ directory. I just don't know why it thinks it needs that file – where that dep is coming from

Alexis Dumas 2025-05-26T14:46:14.020759Z

> this message most definitely wouldn't exist if the shared.js file actually failed to load? right, but shadow-cljs doesn't seem to be working properly, so I'm more inclined to say something didn't load that was required, and it's just incorrectly printing something that indicates it did

Alexis Dumas 2025-05-26T14:47:13.766329Z

> what is the build config used? Here's my shadow-cljs.edn:

{:source-paths ["src" "../src/cljc" "../src/commonjs"]

 :dependencies [
                [reagent "1.2.0"]
                [functionalbytes/sibiro "0.1.4"]
                [re-frame "1.2.0"]
                [dk.cst/xml-hiccup "0.1.5"]
                [com.cognitect/transit-cljs "0.8.280"]
                ]

 :builds
 {
  :mobile {:target     :react-native
           :output-dir "out"
           :asset-path "out"
           :init-fn    yact.mobile/init
;;           :devtools   {:after-load yact.mobile/init}}}

   :devtools {:autoload true
              :preloads [shadow.expo.keep-awake]}}}
:js-options {
             ;;:resolve "node_modules"

             ;;:resolve {"react" "node_modules/react"
             ;;          "react-dom" "node_modules/react-dom"}
             ;;:js-package-dirs ["react-native/node_modules"]
             }
 :compiler-options {
                    :output-feature-set :es5
                    :infer-externs :auto
                    }
 }

thheller 2025-05-26T14:48:53.352749Z

and you have a running watch for the :mobile build? npx shadow-cljs watch mobile?

Alexis Dumas 2025-05-26T14:52:03.985779Z

yes

Alexis Dumas 2025-05-26T14:53:08.756209Z

Alexis Dumas 2025-05-26T14:54:20.123859Z

Sometimes, but not consistently, I also get these errors from the npx expo process:

(NOBRIDGE) WARN  The shadow-cljs Websocket was disconnected.
 (NOBRIDGE) ERROR  shadow-cljs - remote-error {"isTrusted": false, "message": "Failed to connect to /192.168.254.14:9630"}
 (NOBRIDGE) WARN  The shadow-cljs Websocket was disconnected.
 (NOBRIDGE) ERROR  shadow-cljs - remote-error {"isTrusted": false, "message": "Failed to connect to /192.168.254.14:9630"}
 (NOBRIDGE) WARN  shadow-cljs: giving up trying to connect to  

Alexis Dumas 2025-05-26T14:54:30.928819Z

these always seem to come around 10-30mins after the first errors

thheller 2025-05-26T15:52:40.444999Z

what is unclear is why it is trying to refernence files from the app dir when shadow-cljs is generating the files into the out dir

💯 1
thheller 2025-05-26T15:53:29.948419Z

and normally it shouldn't refer to those individual files at all since everything is loaded from the out/index.js directly

👀 1
Alexis Dumas 2025-05-26T16:51:04.468289Z

interesting

Alexis Dumas 2025-05-26T16:51:23.227079Z

I've tried deleting .shadow-cljs to wipe any leftover cache or configuration or whatever, but that didn't seem to help

Alexis Dumas 2025-05-26T16:51:32.352589Z

let me try doing a project-wide grep to see if I've hardcoded this somewhere

thheller 2025-05-26T16:52:12.683549Z

under which circumstances does the error happen? maybe triggered over the REPL? or hot-reload? or does it happen directly on load?

Alexis Dumas 2025-05-26T16:53:03.432549Z

As soon as I run npx shadow-cljs watch :mobile and then npx expo run:android -d

Alexis Dumas 2025-05-26T16:53:21.052819Z

it can't even begin to hot reload at all, that's actually why I'm trying to track this issue down in the first place

Alexis Dumas 2025-05-26T16:53:30.617129Z

since otherwise, every change I make takes 1-2 mins to see on the device

thheller 2025-05-26T16:54:31.981349Z

the only file anything should be referencing is out/index.js the other files basically only exists for REPL purposes

Alexis Dumas 2025-05-26T16:54:41.252169Z

I'm totally new to Clojure, let alone React Native or anything, and this is someone else's project I've been brought on to help with, so there may be stray config files or something I'm missing

Alexis Dumas 2025-05-26T16:54:59.219619Z

> the only file anything should be referencing is out/index.js the other files basically only exists for REPL purposes hmmmm

thheller 2025-05-26T16:55:13.595559Z

its been many years since I looked at anything react-native/expo, so not even sure how configs look on that side these days

thheller 2025-05-26T16:55:33.576019Z

either the expo config should directly refer to out/index.js

thheller 2025-05-26T16:55:39.928619Z

or some other JS file

Alexis Dumas 2025-05-26T16:55:43.541479Z

I'll try to find it

Alexis Dumas 2025-05-26T16:56:45.013039Z

one other possible factor is that I did try to connect to shadow-cljs through cider – so, presumably the repl, if I understand the byzantine architecture of all this correctly – once or twice, but it errored out both times so I gave up and decided to just use figwheel for close-enough editor support and run shadow-cljs in the background

Alexis Dumas 2025-05-26T16:56:56.852529Z

so maybe there's some kind of left over half-built JS or some conflict going on

thheller 2025-05-26T16:57:30.550539Z

🤷

😆 1
Alexis Dumas 2025-05-26T16:57:50.526799Z

{
  "expo": {
    "name": "yact",
    "slug": "yact",
    "version": "1.0.0",

    "icon": "./assets/icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/splash-icon.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "newArchEnabled": true,
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "yact"
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.yact"
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 35,
            "targetSdkVersion": 34,
            "buildToolsVersion": "35.0.0",
            "kotlinVersion": "1.9.25"
          }
        }
      ],
      [
      "react-native-ble-plx",
       {
          "isBackgroundEnabled": true,
          "modes": ["peripheral", "central"],
          "bluetoothAlwaysPermission": "Allow $(PRODUCT_NAME) to connect to bluetooth devices"
        }
    ]]
  }
}

Alexis Dumas 2025-05-26T16:57:53.556129Z

this is the expo config

Alexis Dumas 2025-05-26T16:58:02.475409Z

no mention to app/ or anything that I can see

thheller 2025-05-26T16:58:12.839189Z

maybe package.json?

thheller 2025-05-26T16:58:20.315959Z

or just <project>/index.js

Alexis Dumas 2025-05-26T16:58:34.802489Z

it just says "main": "index.js"

Alexis Dumas 2025-05-26T16:58:35.685319Z

hmm

thheller 2025-05-26T16:58:48.952209Z

ok, so <project>/index.js it is

Alexis Dumas 2025-05-26T16:59:00.623299Z

and that file does exist

Alexis Dumas 2025-05-26T16:59:09.060799Z

thheller 2025-05-26T16:59:26.086679Z

and likely has a import "./out/index.js" or require

thheller 2025-05-26T16:59:42.168349Z

if its referencing anything else in the out dir that should be rmeoved

Alexis Dumas 2025-05-26T17:00:20.073689Z

Yeah, it's importing...

Alexis Dumas 2025-05-26T17:00:25.575789Z

man, I hate codebases I didn't write

Alexis Dumas 2025-05-26T17:00:33.743139Z

it's importing Blah from ./out/index.js

Alexis Dumas 2025-05-26T17:01:04.650729Z

anyway yeah, and the out directory has all the shadow-cljs related files that the program is looking for in app for some reason

Alexis Dumas 2025-05-26T17:01:18.628819Z

thheller 2025-05-26T17:01:50.508639Z

seems fine to me

Alexis Dumas 2025-05-26T17:01:59.973709Z

yeah, so why is it trying to pull from app/...

Alexis Dumas 2025-05-26T17:03:00.458429Z

what if I just change the output dir in shadow-cljs.edn

thheller 2025-05-26T17:03:03.514429Z

maybe something in the code trying to do something clever? kinda hard to debug this without seeing anything

Alexis Dumas 2025-05-26T17:03:12.709859Z

yeah that's 100% fair

Alexis Dumas 2025-05-26T17:03:44.903559Z

let me see if just changing where it sends all the output makes the error go away at least; I'd like to understand what's /causing/ this, but we can't have everything in life

thheller 2025-05-26T17:04:48.178809Z

you can check the out/index.js, there should be a line starting with SHADOW_ENV.evalLoad("shadow.cljs.devtools.client.shared.js" ...

Alexis Dumas 2025-05-26T17:05:50.332449Z

OKay, wait this is progress

Alexis Dumas 2025-05-26T17:06:17.710929Z

okay, so replacing out/index.js with app/index.js, and setting the output and assets directories in shadow-cljs.edn to app/ has eliminated the error about not being able to find a module

Alexis Dumas 2025-05-26T17:06:26.027909Z

but the other errors, and the underlying problem I'm trying to fix, remain

Alexis Dumas 2025-05-26T17:06:33.199929Z

so the big error was a red herring

thheller 2025-05-26T17:06:53.704249Z

not a good strategy IMHO. best to identify first what is trying to load that file, since that is the thing that shouldn't be happening in the first place. just accepting that it happens is no good

Alexis Dumas 2025-05-26T17:08:26.584739Z

right but if accepting that it happens and eliminating /that/ error still leads to the main thing I was trying to fix, that does tell us something useful at least?

Alexis Dumas 2025-05-26T17:08:51.392209Z

but yeah I should probably figure out why it's happening. I usually would but this whole project is a clusterfck and I don't want to lose any more sanity points lol

thheller 2025-05-26T17:08:58.078339Z

what error is that?

Alexis Dumas 2025-05-26T17:09:39.663289Z

right, so having everything shadow-cljs generates end up where it expects (in the app/ directory) eliminates the big error where it can't find the shared devtools module

Alexis Dumas 2025-05-26T17:09:46.226169Z

now all I get is this:

(NOBRIDGE) WARN  The shadow-cljs Websocket was disconnected.
 (NOBRIDGE) ERROR  shadow-cljs - remote-error {"isTrusted": false, "message": null}
 (NOBRIDGE) LOG  shadow-cljs #8 ready!

thheller 2025-05-26T17:10:01.203789Z

shadow.cljs.devtools.client.* are all the namespaces related to hot-reload/REPL. so if for some reason they get loaded twice the connection will be unreliable at best I'd say

Alexis Dumas 2025-05-26T17:10:39.649909Z

there's only one such line in app/index.js

thheller 2025-05-26T17:10:55.794629Z

thats correct. just wanted to check its actually there.

👍 1
Alexis Dumas 2025-05-26T17:11:19.381199Z

yup I was confirming

Alexis Dumas 2025-05-26T17:11:21.851049Z

that I found it

Alexis Dumas 2025-05-26T17:12:18.145219Z

it's definitely there, and it's not duplicated, so hopefully that narrows it down a bit. I'm gonna take a look at SHADOW_ENV and see where it's getting its value from and what's in it, maybe that'll have a hint as to where it's getting app from

Alexis Dumas 2025-05-26T17:13:06.814819Z

ah ok no luck there, that happens prior it looks like

thheller 2025-05-26T17:13:08.292549Z

if it gets to LOG shadow-cljs #8 ready! then everything seems fine. that has loaded all the code and the websocket connected

thheller 2025-05-26T17:13:32.263229Z

you can run npx shadow-cljs clj-repl and then (shadow/get-server-addrs)

Alexis Dumas 2025-05-26T17:13:36.538799Z

right, but it says websocket disconnected and remote error before it says ready, which is odd. that seems like a race condition almost

thheller 2025-05-26T17:13:45.190389Z

that'll give you a list of addrs the client will attempt to connect to. if there is more than one that may explain the disconnect msg

Alexis Dumas 2025-05-26T17:13:57.049339Z

ok, lemme take a look

thheller 2025-05-26T17:14:37.227249Z

the connect logic will try them all in sequence until it finds one it can connect to

Alexis Dumas 2025-05-26T17:14:38.319609Z

nope, only one address, my computer's IP address

thheller 2025-05-26T17:14:53.967939Z

hmm ok then I don't know why it would fail and then succeed

Alexis Dumas 2025-05-26T17:14:57.837899Z

oh hey that's interesting. killing the watch and starting the repl gave me a few more errors

Alexis Dumas 2025-05-26T17:15:07.627159Z

(NOBRIDGE) WARN  The shadow-cljs Websocket was disconnected.
 (NOBRIDGE) ERROR  shadow-cljs - remote-error {"isTrusted": false, "message": null}
 (NOBRIDGE) WARN  The shadow-cljs Websocket was disconnected.
 (NOBRIDGE) ERROR  shadow-cljs - remote-error {"isTrusted": false, "message": "Failed to connect to /192.168.254.14:9630"}
 (NOBRIDGE) WARN  The shadow-cljs Websocket was disconnected.
 (NOBRIDGE) ERROR  shadow-cljs - remote-error {"isTrusted": false, "message": "Failed to connect to /192.168.254.14:9630"}
 (NOBRIDGE) WARN  The shadow-cljs Websocket was disconnected.
 (NOBRIDGE) ERROR  shadow-cljs - remote-error {"isTrusted": false, "message": "Failed to connect to /192.168.254.14:9630"}
 (NOBRIDGE) WARN  shadow-cljs: giving up trying to connect to  

thheller 2025-05-26T17:15:11.486159Z

is there maybe another instance of shadow-cljs still running?

Alexis Dumas 2025-05-26T17:15:19.160529Z

let me see

thheller 2025-05-26T17:15:39.512229Z

just 2 instances fighting with each other? I added protection for this a while ago, but dunno which version you are running

Alexis Dumas 2025-05-26T17:15:44.388399Z

if this is a case of duplicate shadow-cljs servers, with one connecting and one not, that wouldn't explain why hot reloading is breaking though would it?

Alexis Dumas 2025-05-26T17:16:12.850899Z

> just 2 instances fighting with each other? I added protection for this a while ago, but dunno which version you are running

shadow-cljs - config: /Users/alexispurslane/Development/yact/mobile/shadow-cljs.edn
=== npm package
cli:                  2.28.23
config-version:       2.28.23

=== shadow-cljs version (via npm)
shadow-cljs version:  2.28.23

=== Java
openjdk version "23.0.2" 2025-01-21
OpenJDK Runtime Environment Homebrew (build 23.0.2)
OpenJDK 64-Bit Server VM Homebrew (build 23.0.2, mixed mode, sharing)

=== Source Paths
/Users/alexispurslane/Development/yact/mobile/src
/Users/alexispurslane/Development/yact/src/cljc
/Users/alexispurslane/Development/yact/src/commonjs

thheller 2025-05-26T17:16:15.042229Z

it all depends 😛

😁 1
Alexis Dumas 2025-05-26T17:16:18.873439Z

it's old because that's what the project used

Alexis Dumas 2025-05-26T17:16:38.861999Z

I could try updating it, but I'm afraid to do that lol

thheller 2025-05-26T17:16:43.402939Z

that is fairly recent, definitely has that check

Alexis Dumas 2025-05-26T17:17:47.380769Z

okay... it looks like there may be another shadow-cljs instance. but then that's odd, since the ones I was starting werent' complaining or anything

thheller 2025-05-26T17:18:26.090599Z

zombies are no good, so kill that one just to be sure

👍 1
Alexis Dumas 2025-05-26T17:18:43.273809Z

it's a java process with a massive classpath list?

Alexis Dumas 2025-05-26T17:19:12.796239Z

aw fuck no that was my figwheel instance lol

Alexis Dumas 2025-05-26T17:19:21.362889Z

it was just loading shadow-cljs related stuff...?

Alexis Dumas 2025-05-26T17:19:24.051199Z

well let's see if that helps

thheller 2025-05-26T17:19:37.197949Z

unlikely, but dunno what figwheel is doing in this setup 😛

thheller 2025-05-26T17:19:53.710629Z

definitely better to keep it away while debugging this

Alexis Dumas 2025-05-26T17:19:55.876229Z

oh man you don't wanna know. I disavow any and all things related to this fucked dev environment

Alexis Dumas 2025-05-26T17:20:01.143989Z

I was /not/ consulted

Alexis Dumas 2025-05-26T17:20:59.531219Z

basically we have a react (reagent/re-frame) app and a react native app conjoined at the hip, sharing not just core business logic but also a lot of UI code via wrappers that are compiled from different modules based on the architecture compiled for

Alexis Dumas 2025-05-26T17:21:17.256139Z

so I need to keep figwheel and shadow-cljs going at once so that when I make a change for web, I know it doesn't break mobile, or vice versa

thheller 2025-05-26T17:21:38.394539Z

we can talk about that later. for now just don't run it 😛

😂 1
Alexis Dumas 2025-05-26T17:21:57.439089Z

okay, let me rerun everything now that figwheel is gone and see what happens

Alexis Dumas 2025-05-26T17:24:24.629639Z

just to confirm, I'm supposed to be running the shadow-cljs command, and then the expo run android command one after the other, right?

thheller 2025-05-26T17:24:49.220689Z

I'd wait till shadow-cljs finishes the build, then run expo

Alexis Dumas 2025-05-26T17:24:56.638829Z

yeah that's what I'm doing

👍 1
Alexis Dumas 2025-05-26T17:25:06.283449Z

okay, no, figwheel being gone doesn't change anything

thheller 2025-05-26T17:25:31.326009Z

so change :output-dir "foo" and index.js to use ./foo/index.js

thheller 2025-05-26T17:25:41.139569Z

i.e. a completely empty new dir

Alexis Dumas 2025-05-26T17:25:57.394459Z

still getting "android bundled ... some initial app debug logs... [big app hang] ... [the errors]"

Alexis Dumas 2025-05-26T17:26:01.927689Z

ok will do

Alexis Dumas 2025-05-26T17:26:09.370659Z

app/ was completely new and empty tbf

Alexis Dumas 2025-05-26T17:26:17.003169Z

but it was somehow expected previously, so yeah

thheller 2025-05-26T17:26:41.425679Z

well, yeah we still need to verify that nothing references the app dir anymore

Alexis Dumas 2025-05-26T17:28:53.423429Z

well, I assume stuff does, since I eliminated the error temporarily by just putting things in app/ where it expected them and... oh so this is interesting

Alexis Dumas 2025-05-26T17:29:21.492219Z

okay, so I switched the output and assets dirs, then started shadow-cljs, waited for it to finish building, then started expo

Alexis Dumas 2025-05-26T17:29:24.061409Z

and I got this message:

Alexis Dumas 2025-05-26T17:29:36.223819Z

(NOBRIDGE) ERROR  Stale Output! Your loaded JS was not produced by the running shadow-cljs instance. Is the watch for this build running?

thheller 2025-05-26T17:30:09.944319Z

could be that expo is caching something somewhere? i.e. not using that latest output?

Alexis Dumas 2025-05-26T17:30:32.044819Z

let me see if there are any sneaky cache directories

thheller 2025-05-26T17:30:39.182779Z

:asset-path is btw not an option for :target :react-native so you can just remove that. it does nothing.

Alexis Dumas 2025-05-26T17:30:49.794349Z

ah okay

Alexis Dumas 2025-05-26T17:31:06.902769Z

alright, I could just delete .expo again

Alexis Dumas 2025-05-26T17:32:49.123699Z

deleting .expo does not resolve the cache message, let me look somewhere else

Alexis Dumas 2025-05-26T17:33:20.076029Z

but! interestingly, there doesn't seem to be any error about not being able to find a module anymore

Alexis Dumas 2025-05-26T17:33:21.676469Z

so there's that

Alexis Dumas 2025-05-26T17:35:59.339339Z

ohhhhh

Alexis Dumas 2025-05-26T17:36:19.063709Z

it's because when we switched to foo/ I forgot to change that in <projectdir>/index.js. Okay, back on track

Alexis Dumas 2025-05-26T17:37:57.028619Z

nope, okay, it's still looking for things in ./app, and we still get the strange "websocket disconnected" "remote-error" /then/ "shadow-cljs #4 is ready!" stuff

thheller 2025-05-26T17:38:47.584549Z

so, just to verify. there is only the shadow-cljs watch running. you are not connected to the REPL via your editor or anything else?

Alexis Dumas 2025-05-26T17:38:57.693969Z

yes

thheller 2025-05-26T17:39:33.529629Z

so then a grep or whatever to find app/ should show up somewhere?

thheller 2025-05-26T17:39:40.836339Z

I mean it must be coming from somewhere

thheller 2025-05-26T17:39:59.091619Z

just grep all .js files

thheller 2025-05-26T17:40:57.724879Z

maybe search for shadow.cljs.devtools.client.shared but that should have a lot of hits, so requires more filtering

thheller 2025-05-26T17:41:24.949799Z

what else is in the <project>/index.js?

thheller 2025-05-26T17:42:56.486669Z

maybe reference https://github.com/thheller/reagent-expo if you haven't?

Alexis Dumas 2025-05-26T17:43:39.208349Z

okay so yeah when I ran the grep originally I didn't realize it was obeying .gitignore. there are a lot of hits looking for localhost:8081/app/<various source files, including shadow.cljs.devtools.client.shared> in out/index.js

Alexis Dumas 2025-05-26T17:46:34.625919Z

but if it's coming from somewhere, at least so far it's way too lost in the results. I'll keep trying to filter

thheller 2025-05-26T17:46:36.508059Z

likely only the sourceURL for source map purposes? otherwise dunno where localhost would be coming from

Alexis Dumas 2025-05-26T17:47:06.733419Z

yeah

Alexis Dumas 2025-05-26T17:47:26.374209Z

e.g. # sourceURL\x3d\n\n

Alexis Dumas 2025-05-26T17:47:56.897069Z

I didn't spot the sourceURL there at first, so I was hoping for it to be moreuseful

thheller 2025-05-26T17:48:23.442209Z

honestly I have no clue how any of this works even looking at https://github.com/thheller/reagent-expo

thheller 2025-05-26T17:48:47.600569Z

makes fuck all sense that this is referencing a default export that doesn't exist at all

Alexis Dumas 2025-05-26T17:50:06.377009Z

pain

thheller 2025-05-26T17:50:37.546769Z

maybe just try running npx shadow-cljs compile mobile once (with no watch running)

Alexis Dumas 2025-05-26T17:50:46.746549Z

alright, let's see

thheller 2025-05-26T17:51:01.065709Z

just to see if it still tries to load that file at all

thheller 2025-05-26T17:51:09.788839Z

it shouldn't attempt to connect to anything

Alexis Dumas 2025-05-26T17:51:23.765229Z

makes sense given what the reagent docs say

Alexis Dumas 2025-05-26T17:51:27.491109Z

let's see.

Alexis Dumas 2025-05-26T17:51:43.391659Z

my computer isn't slow, neither is my phone, but this whole round trip is lke tryihng to download a 4K video over dialup

Alexis Dumas 2025-05-26T17:52:11.535769Z

okay, so yeah, when properly compiled instead of watched, it doesn't try to reference anything external

thheller 2025-05-26T17:55:24.413209Z

then my only guess is that the expo stuff for some reason makes use of the sourceURL and gets the app/ from there, since that is hardcoded I guess https://github.com/thheller/shadow-cljs/blob/40d9ae9d27bc61f83e3afc76771fc17f9aa68be9/src/main/shadow/build/targets/react_native.clj#L190

thheller 2025-05-26T17:55:43.942889Z

just use :output-dir "app" I guess

Alexis Dumas 2025-05-26T17:55:49.965299Z

full circle lol

thheller 2025-05-26T17:56:09.219129Z

FWIW the compile will also still reference that, but it won't have any reference to the shadow.cljs.devtools.client.... stuff

👍 1
Alexis Dumas 2025-05-26T17:56:38.378949Z

okay, so what about the shadow cljs server being both ready and failing to connect? I don't have a firewall on or anything

🤷 1
Alexis Dumas 2025-05-26T17:57:05.902639Z

and that IP address that cljs is looking to connect to is accessible on the local wifi network

Alexis Dumas 2025-05-26T17:57:10.443639Z

alright then lol

thheller 2025-05-26T17:57:43.429229Z

this is the code doing the connect logic

thheller 2025-05-26T17:58:09.433949Z

you can take this file and put it into your classpath into the proper location

thheller 2025-05-26T17:58:28.066569Z

so src/main/shadow/cljs/devtools/client/react_native.cljs or whatever source path you use

thheller 2025-05-26T17:58:37.778709Z

you can then add more logging to maybe figure this out

thheller 2025-05-26T17:58:40.797429Z

I give up 😛

Alexis Dumas 2025-05-26T17:58:59.383929Z

thanks for your help! I'll do that and see if I'm able to figure anything out

thheller 2025-05-26T17:59:34.386739Z

it shouldn't even get to that line if there really is only one address

👀 1
thheller 2025-05-26T18:00:44.327459Z

if you can repro this I can take a look, but going over this blind makes this rather hard

Alexis Dumas 2025-05-26T18:01:01.027239Z

yeah, I'll check back if I figure out a way to reproduce this

Alexis Dumas 2025-05-26T18:01:18.425089Z

but even replicating this escheresque project structure would be a multi-day project /hj

thheller 2025-05-26T18:02:24.416639Z

yeah no clue why anyone would use figwheel and shadow-cljs at the same time

Alexis Dumas 2025-05-26T18:02:37.217389Z

😭

Alexis Dumas 2025-05-25T18:47:42.833709Z

I'm quite inexperienced with this stuff so I'd really appreciate some pointers