Fork me on GitHub
#shadow-cljs
<
2022-10-22
>
janezj13:10:26

In my app deployed in prod I have a special url which serves index.html pointing to main.js on localhost. <div id="app"></div><script src=""></script> This is great way to try a new frontend in a production. And even fulcro inspect is working. Connecting shadow-cljs server is solved by changing devtools-url. (when *localjs* [:script "shadow.cljs.devtools.client.env.devtools_url=':' + shadow.cljs.devtools.client.env.server_port"])]])) But there are still hundreds 404s when loading *.maps https://production.example.com/js/main/cljs-runtime/com.fulcrologic.rad.rendering.semantic_ui.semantic_ui_controls.js.map So is there a similar way to load *.map files from localhost?

thheller16:10:58

:asset-path controls this, it is badly named so it isn't obvious but it accepts a full url

thheller16:10:48

so you access localhost but proxy to your production server for any request that isn't available locally (ie. all non-local files/routes)

thheller16:10:11

that way local JS is typically used basically "overriding" the remote JS

thheller16:10:31

you also don't need to set the devtools url via some :script

janezj08:10:47

Thanks, I will try to set it with bb and --config-merge

oskarkv16:10:38

I'm not sure if this is the right channel, but when I get errors I see a JS stack trace, like in the screen shot. Is there a way to get that as a cljs stack trace, with line numbers from my cljs files?

thheller16:10:53

dunno. which browser is this? source maps are provided, whether your browser makes use of them shadow-cljs has no influence over

oskarkv17:10:36

It's a Tauri app.

thheller17:10:22

no clue how that handles source maps

oskarkv17:10:44

Hm, only Firefox seems to use them (not Brave or Chrome). Thanks! I'll try to find out more.

oskarkv18:10:45

No, they work in Chrome and Brave. And setting :loader-mode to :script makes them work in Tauri too.

thheller16:10:09

the error above is basically (assoc 26 :whatever "invalid")

thheller16:10:24

in app.screens somewhere