shadow-cljs

juhoteperi 2026-04-15T09:42:33.213699Z

I'm seeing some Websocket problems on 3.4.2 on Linux. File changes trigger compilation OK. On browser I get the spinner about a change, but it gets stuck.

juhoteperi 2026-04-15T09:43:15.533099Z

On log I occasionally see

Exception in thread "" java.lang.AbstractMethodError: Receiver class shadow.http.server.CoreAsyncWebSocketHandler does not define or inherit an implementation of the resolved method 'abstract void onPing(byte[])' of interface shadow.http.server.WebSocketHandler.
	at shadow.http.server.WebSocketExchange.process(WebSocketExchange.java:71)
	at shadow.http.server.SocketConnection.run(SocketConnection.java:71)
	at java.base/java.util.concurrent.ThreadPerTaskExecutor$TaskRunner.run(ThreadPerTaskExecutor.java:314)
	at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)
Or
[:front] Build completed. (3730 files, 2 compiled, 0 warnings, 0.46s)
Exception in thread "" java.net.SocketException: Socket closed
	at java.base/sun.nio.ch.NioSocketImpl.endWrite(NioSocketImpl.java:379)
	at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:422)
	at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440)
	at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:819)
	at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1195)
	at shadow.http.server.WebSocketExchange.sendFrame(WebSocketExchange.java:211)
	at shadow.http.server.WebSocketExchange.sendTextInternal(WebSocketExchange.java:173)
	at shadow.http.server.WebSocketExchange.sendText(WebSocketExchange.java:150)
	at shadow.http.server.CoreAsyncWebSocketHandler$fn__20077$fn__20078.invoke(server.clj:36)
	at shadow.http.server.CoreAsyncWebSocketHandler$fn__20077.invoke(server.clj:34)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)

juhoteperi 2026-04-15T09:48:25.687949Z

I'll try checking deps tree if our project has something that might affect this

thheller 2026-04-15T09:51:34.141009Z

fixed in 3.4.3

thheller 2026-04-15T09:52:18.217089Z

just a method implementation I missed

thheller 2026-04-15T09:52:41.902619Z

curious which browser? chrome on macos doesn't seem to send websocket ping frames?

juhoteperi 2026-04-15T09:52:53.447019Z

Firefox @ Linux

thheller 2026-04-15T09:54:18.488719Z

good to know. should be fine now.

juhoteperi 2026-04-15T09:55:11.045359Z

Testing. I did also see we have older versions of a few deps in the classpath (commons-io, ring-core, ring-codec).

juhoteperi 2026-04-15T10:03:19.709559Z

No errors on the log, spinner shows on the browser after a change but gets stuck and WS reconnects after a moment. I solved the conflicting transitive deps, so those should be OK.

juhoteperi 2026-04-15T10:04:59.897759Z

(No errors on the terminal.) This is on browser console

juhoteperi 2026-04-15T10:06:30.276509Z

Same on Chrome for me.

thheller 2026-04-15T10:08:54.494499Z

don't think there are any transitive deps that could affect this

juhoteperi 2026-04-15T10:09:28.036669Z

Yeah, just wanted to remove that variable to be sure

thheller 2026-04-15T10:09:42.310179Z

something on the server side log?

juhoteperi 2026-04-15T10:09:54.020819Z

[:front] Build completed. (3728 files, 2 compiled, 0 warnings, 0.44s) Exception in thread "" java.net.SocketException: Connection reset by peer at java.base/sun.nio.ch.SocketDispatcher.write0(Native Method) at java.base/sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:62) at java.base/sun.nio.ch.NioSocketImpl.tryWrite(NioSocketImpl.java:394) at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:410) at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440) at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:819) at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1195) at shadow.http.server.WebSocketExchange.sendFrame(WebSocketExchange.java:211) at shadow.http.server.WebSocketExchange.sendTextInternal(WebSocketExchange.java:173) at shadow.http.server.WebSocketExchange.sendText(WebSocketExchange.java:150) at shadow.http.server.CoreAsyncWebSocketHandler$fn__20077$fn__20078.invoke(server.clj:36) at shadow.http.server.CoreAsyncWebSocketHandler$fn__20077.invoke(server.clj:34) at clojure.lang.AFn.run(AFn.java:22) at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)

thheller 2026-04-15T10:09:57.092969Z

Exception in thread "" java.lang.AbstractMethodError: Receiver class shadow.http.server.CoreAsyncWebSocketHandler does not define or inherit an implementation of the resolved method 'abstract void onPing(byte[])' of interface shadow.http.server.WebSocketHandler.
should be gone

juhoteperi 2026-04-15T10:10:00.476209Z

Still seeing this one ocassionally

juhoteperi 2026-04-15T10:11:07.149499Z

That message doesn't appear right after change -> reconnect or anything, but sometime later

juhoteperi 2026-04-15T10:15:10.980229Z

> Close Code 1006 is a special code that means the connection was closed abnormally (locally) by the browser implementation.

thheller 2026-04-15T10:23:54.528799Z

I suspect that it might have to do with websocket text frame sizing

thheller 2026-04-15T10:24:41.392959Z

might try to send a large frame might be broken up somehow. checking if I can reproduce this somehow.

juhoteperi 2026-04-15T10:25:44.021629Z

If I remember correctly, the compiled JS code is sent over WS to the browser, so it would make sense that in this project the message is quite large

thheller 2026-04-15T11:00:12.576459Z

can you give com.thheller/shadow-http {:mvn/version "0.1.4"} a shot? just manually adding it as a dep and trying again? don't need to make a new shadow-cljs release if it doesn't work.

juhoteperi 2026-04-15T11:03:20.903629Z

Yep, works now:

juhoteperi 2026-04-15T11:04:42.769529Z

cljs-build-complete message is 1.4MB

juhoteperi 2026-04-15T11:06:35.788749Z

@thheller Thanks for the super fast fix again 🙂

thheller 2026-04-15T11:10:59.209479Z

thanks for testing. shadow-cljs 3.4.4 is the proper update then. better remove the fixed shadow-http dep so you don't miss updates there.

ullrich 2026-04-15T14:06:05.667069Z

Piggybacking on here. We noticed hot reloading stopped working when we went from 3.3.6 to 3.4.2 (filed https://github.com/thheller/shadow-cljs/issues/1259 just now). A websocket issue sounds like a plausible culprit to this. I'll test with 3.4.4 when I find the time. Right now I need to move our org back to 3.3.6 so folks are unblocked 😄