S
SolidJS5mo ago
Claloi

EventSource's response has a MIME type ("text/html") that is not "text/event-stream".

I'm trying to make SSE, but when i load the website I'm getting that error in the console of the website: EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection. I'm just confused how and where to fix that.
3 Replies
Claloi
ClaloiOP5mo ago
Somehow, I'm getting the createHandler from entry-server.tsx instead of my data.
peerreynders
peerreynders5mo ago
I had to set the content-type myself. Now granted, this was before h3 experimental support for SSE was added; I haven't tried to adapt the demo to that yet. Also you may need to be aware of this; tldr: the parts of SolidStart that serve routes and the part that deals with “Server Functions” are partitioned as far a server memory goes.
WebSockets - h3
H3 has built-in support for cross platform WebSocket and SSE.
GitHub
solid-start-sse-chat/src/routes/api/messages.ts at d2b9070f956947c9...
Basic Chat demonstration with server-sent events (SSE) - peerreynders/solid-start-sse-chat
Claloi
ClaloiOP5mo ago
Thank, finally it was mostly a error on my side when i create the api route folder I forgot that my capslock was on so it was API instead of api.
Want results from more Discord servers?
Add your server