Vincent Udén
Vincent Udén
Explore posts from servers
SSolidJS
Created by Dido on 11/14/2023 in #support
SyntaxError: The requested module 'solid-js/web' does not provide an export named 'classList'
Yeah it's been a suprisingly common problem for me, components breaking in ssr. I'm not clever enough to figure out the solutions if there are any goods ones. It's a little bit demotivating tbh, but at least there are usually alternative libraries which do work
5 replies
SSolidJS
Created by Dido on 11/14/2023 in #support
SyntaxError: The requested module 'solid-js/web' does not provide an export named 'classList'
I've had some problems with similar issues but I'm no expert so forgive me if I'm wrong. The problem is that solid-slider expects to be rendered only on client and thus uses the classList export from solid-js/web either directly or in one of it's dependencies. classList isn't exported from the server version of solid-js/web much like template or some other constructs due to the SSR not being done in a browser, but rather in node. For me the fix has been to import some of my components as client only. This means they don't get SSRed but still allows me to use them. To do this, use
import { unstable_clientOnly } from "solid-start";

const Plot = unstable_clientOnly(() => import("../components/Plot"));
import { unstable_clientOnly } from "solid-start";

const Plot = unstable_clientOnly(() => import("../components/Plot"));
Where you replace the import with your component that needs to be client only. This hasn't worked in all cases for me. I have no good understanding of when it works and when it doesn't. I've asked about it here before and got no answer. Also I realise this assumes you're using solid-start which you might not be. If you aren't, I wish you the best of luck on finding another solution
5 replies
SSolidJS
Created by Vincent Udén on 11/9/2023 in #support
`unstable_clientOnly` doesn't solve SSR issues when importing a dependency
I ended up switching color picker library, but I still would love to know what the actual problem was
2 replies
SSolidJS
Created by Vincent Udén on 8/28/2023 in #support
No Vercel Logs
Also, I'm only getting one single serverless function called /api even though I have many routes. Is this intended? Where would I read about stuff like this so as to avoid asking quetsions next time?
3 replies
SSolidJS
Created by Vincent Udén on 8/28/2023 in #support
No Vercel Logs
I'd be happy to provide more details if there's something that would help me get to the bottom of the problem
3 replies
SSolidJS
Created by Vincent Udén on 7/6/2023 in #support
createResource refetch causes full page refresh
That worked like a charm, thank you!
9 replies
SSolidJS
Created by Vincent Udén on 7/6/2023 in #support
createResource refetch causes full page refresh
Makes sense! Should I wrap the entire component, the part which triggers the refetch or the part which depends on the resource?
9 replies