gsoutz
Invalid Frame Header only on production build websockets
Guys, I've found the problem,
export async function GET(event: APIEvent) {
let request = event.nativeEvent.node.req
let { path } = event.params
await handleUpgrade(request)
return undefined
}
this Route API is returning something to the client even though I handle the upgrade myself.
So if I put a delay before this function returns the Invalid Frame Header error is delayed.
So my question is, how do I make a Router API not to return anything or do anything weird, because I am handling the upgrade myself.
3 replies
Invalid Frame Header only on production build websockets
I think I have found the problem. Sorry just getting used to this SSR thing. Probably I need to tell that WebSocket client is clientSide only code.
I seen some documentation where functions are named clientOnlySocketProvider, like that.
I will try that tomorrow. If any of you have a further suggestion feel free to let me know.
3 replies
"use server" doesn't work if put at the top of the file
so cache wrapper is not just an optimization but a necessity to achieve reactivity. I will just leave the use server inside functions as before and move on. Does that sound ok my understanding?
5 replies
How do I do something after a redirect, like reload the page, or in this case reconnect a websocket?
I have this dynamic route u/:username
The action changes the username invalidates the user and redirects to
u/hello to u/world , and I can't get any notification on anywhere.
Except onBeforeLeave occurs but I get the old username 'hello'.
I need a callback after the cache invalidates, so I can reconnect the websocket.
10 replies
How to crossws websocket Resolver API access getSession?
In fact, I honestly don't understand how this handler works, I thought async resolve(req), method is only called once when the websocket connection is established, but it is called everytime a message is exchanged?
3 replies
__vite-browser-external:node:async_hooks:3 Uncaught Error: Module "node:async_hooks" has been extern
I think I solved it by putting "use server" inside
getSession
I didn't know every nested function call has to have that even though outer functions have it already.2 replies
What is wrong with Math.random create Signal
One more thing, I have this for creating a session password:
Where should I put this so it is set once the server starts and never changes on every request, because when I put this at the top level of app.tsx, it changes with every request.
8 replies