Fork me on GitHub
#shadow-cljs
<
2022-02-28
>
jumar06:02:08

I'm getting the following error when running cider-jack-in-cljs in emacs ,the selecting shadow as the repl type

;; ClojureScript REPL type: shadow
;;
[:app] Configuring build.
[:app] Compiling ...
[:app] Build failure:
The required namespace "react" is not available, it was required by "reagent/core.cljs".

To quit, type: :cljs/quit
[:selected :app]
It appears to work when I run it from cli:
npm run dev
...
shadow-cljs - server version: 2.11.23 running at 
shadow-cljs - nREPL server started on port 3333
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (165 files, 164 compiled, 0 warnings, 17.84s)
What could be a reason for that? It worked fine the last week

jumar06:02:17

Nevermind, I found the problem - I was using a wrong shadow-cljs.edn file. The correct one is https://github.com/jumarko/learn-reagent/blob/develop/giggin/shadow-cljs.edn#L1

orestis13:02:35

@lilactown indeed karma works nicely. I am using playwright instead to run against three browsers at a time which is nice. Haven't tried it on CI yet but on Mac it works nicely.

orestis16:02:05

^ also works fine on Travis after a few back-and-forth sessions.

Marconi19:02:56

Hi, I'm developing a web app and source maps work fine on desktop, but not on chrome for android (using the PC's devtools). The message (loads of other files) is: DevTools failed to load source map: Could not load content for http*/cljs-runtime/*.js.map: Fetch through target failed: Target not supported; Fallback: Unknown error Already checked that the URL is accessible in the mobile browser. Any ideas why? And is it possible to get it working? Thanks.

thheller19:02:49

well if you truncate the error message it is really hard to tell what is going on

thheller19:02:04

what Target is it trying to get? like what is the full url of the .map?

thheller19:02:15

"Target" being the host address I'd presume?

thheller19:02:28

maybe try setting :devtools {:loader-mode :script} in your build config

Marconi19:02:56

Sorry, thought it would be irrelevant, since the map file URL opens in the mobile browser successfully. The full path of one of the errors is https://host/cljs-runtime/goog.events.eventid.js.map.

thheller19:02:00

is it a literal host? I mean this is the root of your problem. it doesn't help if you change it 😛

thheller19:02:29

if you are trying to hide a IP then check if its the actual IP reachable by both the host PC and the Android device

Marconi19:02:40

Trying not to expose private info X). It's a FQDN, where the app is running. Like http://myapp.me.com

thheller19:02:57

and that domain AND port is reachable by both?

Marconi19:02:15

Yes. It is the same base address in the browser's address bar. It's being served by an nginx proxying to shadow-cljs.

Marconi19:02:23

I've set :devtools-url in shadow-cljs.edn for it to work through https. In the repl I get to access the mobile browser's runtime

thheller19:02:24

I assume this is using https? is the cert also valid on both devices?

thheller19:02:14

I mean I don't know who is actually trying to get the source maps

thheller19:02:24

sounds like the PC stuff is trying to get it over the android device

thheller19:02:46

dunno what "Unknown error" means. doesn't seem like something shadow-cljs is involved in at all

Marconi19:02:59

Yes. Self signed, but I added it to both browsers and the app works fine, including the https exclusive stuff

thheller19:02:16

hmm yeah but self-signed is always a problem. it might not be trusted by the devtools so thats why it might fail

thheller19:02:48

get a letsencrypt cert. less hassle 😛

Marconi19:02:42

Good idea. Will get that and investigate devtools. Thank you for your help and for shadow-cljs!

👍 1
Marconi23:02:43

I tested first without https, nginx, etc to see if I could reproduce the error. And it still happens: (this time verbatim) DevTools failed to load source map: Could not load content for http://192.168.10.100:5000/cljs-runtime/clojure.string.js.map: Fetch through target failed: Target not supported; Fallback: Unknown error DevTools failed to load source map: Could not load content for http://192.168.10.100:5000/cljs-runtime/shadow.remote.runtime.obj_support.js.map: Fetch through target failed: Target not supported; Fallback: Unknown error Just two examples. There are hundreds of lines like these. What I could identify is that the only file specific to my app is a web worker. My related :modules: :shared {:entries []} :main {:entries [main] :depends-on #{:shared} :preloads [dev-preload]} :worker-pricemeter {:init-fn workers.pricemeter/init :depends-on #{:shared} :web-worker true} Any ideas?

Marconi23:02:36

I also tried :loader-mode :script to no success