Fork me on GitHub
#shadow-cljs
<
2021-07-04
>
thheller06:07:32

@pez it does not. the classpath does not decide what ends up in the build. only your :require does. what isn't required isn't included. see https://code.thheller.com/blog/shadow-cljs/2018/02/08/problem-solved-source-paths.html

pez06:07:02

That's awesome. And a great article explaining it! Thanks!

hadils14:07:36

Hi! I have a problem. I had a shdaow-cljs app that was working, but now the watch function is broken. I am troubleshooting the problem and I found that the websocket connection to localhost:9630 is getting back "access denied" in proper transit format. The result is that the website is showing stale information. Restarting the app and reloading the webpage has no effect. I checked the dependencies and I think they are correct. Any suggestions for how to resolve this? Thanks!

thheller14:07:46

I really gotta expand that error message ...

thheller15:07:20

common problem #1: changing :output-dir OR :modules but not updating your HTML to actually load those files and thus loading the old files

thheller15:07:51

#2: having two instances of shadow-cljs running in the same project and both running watch competing with each other

thheller15:07:39

#3: less common but when using :devtools-url not properly proxying requests?

thheller15:07:06

or what also might happen if you have 2 projects both using shadow-cljs, they'll start on port 9630 and then port 9631. there might be cases where the watch from project a isn't actually running but the files still try to connect although 9630 now belong to another project. doens't seemt to be your case though since you said watch is running

hadils15:07:35

I am not using devtools-url. Let me check #1.

hadils15:07:03

I don't have two proejcts with shadow-cljs.

thheller15:07:32

make sure the server is actually what you think it is

hadils15:07:23

I rebooted. No other shadow-cljs processes running. The link above checks out as my project. I don't know why I'm getting access denied from the websocket reply.

thheller15:07:24

did you verify you are loading the correct files? delete them to be sure

hadils15:07:58

Hmmm, let me check

thheller15:07:01

could also be some sort of cache? maybe you have a service worker installed that caches too aggressively?

hadils15:07:42

Ah. Let me check...

hadils15:07:32

The service-worker was the problem! Thanks, @thheller!

hadils16:07:02

A naive point of view: it doesn't seem like hot code reloading works properly with service-workers. I am sure that I don't have it configured properly...

hadils16:07:20

I take that back. I had installed my pwa which was causing the problem.

hadils20:07:06

Hi again. Can web workers have a different output-dir than the other modules? I would like to use the modules feature to generate my service worker...

thheller20:07:05

a service worker should really be a separate build

thheller20:07:20

makes absolutely no sense to combine it

thheller20:07:28

IMHO I wouldn't even write a service worker in CLJS. probably just use something like https://developers.google.com/web/tools/workbox to generate it

hadils21:07:14

BTW, @thheller, This is an excellent library you have developed. I am really impressed.

😎 3