gsoutz
Invalid Frame Header only on production build websockets
I wrote this simple tutorial, only to realize it's a minimum reproducible example that demonstrates the bug:
Steps to Reproduce:
Look at the websocket connection in the network tab, see it breaks with this error:
Invalid Frame Header.
But if you run,
pnpm dev
The error is gone.
Please fix this "very" obscure error asap, or it's a very shame as I produced it very quickly while writing my tutorial.
3 replies
production build runs my code twice
I have a solid start app I coded some things.
When I run pnpm dev it works fine. But when I do pnpm build, and node .output/index.mjs it logs the things twice on the server log, and my websocket connection breaks with invalid frame header, which is likely related to this running twice thing.
1 replies
"use server" doesn't work if put at the top of the file
I have this code which causes reactive triggers when user is changed by an useAction:
but if I remove the "use server" from inside functions and place it at the top of the file,
The getUser() doesn't reactive update anymore, it breaks.
5 replies
How do I do something after a redirect, like reload the page, or in this case reconnect a websocket?
there is no redirect reload, or some kind of hook that gets called after a redirect has happened to the same dynamic route with different params.
10 replies
Should I destroy and create a new websocket connection on each page?
Or keep the existing connection throughout different pages, and somehow figure out which page should I handle by different means.
I solved all my websocket problems, now this question come to my head, because it takes a split second more to open up the connection and be ready.
3 replies
How to crossws websocket Resolver API access getSession?
I am trying to use WebSockets with crossws, I have this piece of code at the beginning:
getUser() uses "use server" and getSession kind of things, so it needs some Context I think.
But this
getUser()
line throws:
I specifically wanted to put the getUser() there, so I don't have to use it inside message(peer), each time message is exchanged getUser is queried.
So what is the proper way to have access to user object taken from the session and the database, so it's readily available on websocket handlers?3 replies
I can't load app.scss inside app.tsx and load globally on all pages
app.tsx has this:
import "./app.scss";
Which sets the background color of the page.
If I load the home page this style is loaded.
But If I navigate to profile
then navigate back to home page, styling is gone. as this app.scss has never been imported.
If I put this import like this on Home.tsx
like this, it loads on every case as expected.2 replies
__vite-browser-external:node:async_hooks:3 Uncaught Error: Module "node:async_hooks" has been extern
vite-browser-external:node:async_hooks:3 Uncaught Error: Module "node:async_hooks" has been externalized for browser compatibility. Cannot access "node:async_hooks.AsyncLocalStorage" in client code. See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
at Object.get (vite-browser-external:node:async_hooks:3:11)
at http.js:71:53
Here's my code looks like:
2 replies
Websockets in SolidStart Example
I am writing a tutorial for solidhack about how to use WebSocket's in SolidStart, I based my example on this example repo https://github.com/peerreynders/solid-start-ws-demo .
Is this still the best practice, or there is a better way?
2 replies
createResource signal isn't trigger if undefined or null
Sometimes I want resource to return undefined, when the underlying signal goes undefined. That's how I like it. Why is this forbidden?.. If I change undefined with
true
it triggers as I expect it. but undefined makes more sense here.3 replies
set signal batched intermediate sets are lost for animation
This logs only 5, but think about a scenario where I control the klasses of a div, with animation. first I want to reset the animation so I set the signal to undefined, then I set it to three to add the three klass, then five klass.
how does this supposed to be done?
4 replies
Untrack has no effect but signal doesn't fire anyway
Take a look at this way of events:
I trigger an event, and this is the console.log output:
I mean
ok test
doesn't happen because I untracked roundn() but roundn also doesn't happen because fix fix
doesn't log.10 replies
What do I do if I have to wait for things to happen, meanwhile define extra state or what
this piece of code come up as crucial functionality all over the place for me, for an interactive application of solidjs
So I set something, and wait for user to acknowledge it, then I go to next state.
While I am waiting some kind of pending state happening.
Do I keep track of these waiting states, because I have some timing related bugs creeping in my code I don't know how to fix. Not considering waiting for some asynchronous processes on the way.
15 replies