Christian
Christian
SSolidJS
Created by Christian on 1/7/2025 in #support
SolidStart Meta not updating
Was already looking into just forking it but will have to be a future thing as I don't want to waste more time on it at the moment as I have some deadlines to meet unfortunately. I appreciate all the help you've given & advice.
16 replies
SSolidJS
Created by Christian on 1/7/2025 in #support
SolidStart Meta not updating
It’ll be done when it’s done
Very true
16 replies
SSolidJS
Created by Christian on 1/7/2025 in #support
SolidStart Meta not updating
Thanks for the explanation by the way! I must’ve missed it when looking but I always like learning more :) shame that there’s so many bugs unfortunately with the meta but oh well
16 replies
SSolidJS
Created by Christian on 1/7/2025 in #support
SolidStart Meta not updating
I see- unfortunate as I wanted the benefits of solid start to have SSR for SEO but I’ll just omit it for now and upgrade in the future when there are updates. Do you know if there’s an estimated date yet? Hoping soon otherwise I wonder if it’d be worth for me to just migrate off till it’s more stable 🥲
16 replies
SSolidJS
Created by Christian on 1/7/2025 in #support
SolidStart Meta not updating
It seems to start working on client side routing after a HMR reload, but it never works on initial SSR nor when navigating after SSRed. Only after I save a file when the page is already open. Title doesn't even operate correctly when swapping page with non fetched data. I just used a static title and it was still having the same issues except it at least ssred Here are my dependencies
"dependencies": {
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@unpic/solid": "^0.0.50",
"socket.io-client": "^4.8.1",
"solid-js": "^1.8.18",
"vinxi": "^0.4.0"
},
"dependencies": {
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@unpic/solid": "^0.0.50",
"socket.io-client": "^4.8.1",
"solid-js": "^1.8.18",
"vinxi": "^0.4.0"
},
Looking at SolidStarts internals they don't even invoke MetaProvider on the server despite this being recommended in the docs, is there a reason for this, or is it supposed to be either or?
16 replies
SSolidJS
Created by Christian on 1/7/2025 in #support
SolidStart Meta not updating
Issue persists even with Suspense added. I had a suspense above my router originally but moved it into my Layout for the sake of getting it 1:1 and still happens. I also tried swapping to FileRoutes yesterday but issue was still persisting. I've spent like 8 hours on this now.
16 replies
SSolidJS
Created by Christian on 1/7/2025 in #support
SolidStart Meta not updating
None are hard coded into the entry-server, below is nearly exactly my setup. Yet when I go to /test (in this example) it'll show the default title from Layout, and sometimes, maybe 10-20% of the time it'll display the data().name but ONLY when loading the page with initial SSR and never on client side page load.
export default createHandler(() => (
<StartServer
document={({ assets, children, scripts }) => (
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
{assets}
</head>
<body>
<div id="app">{children}</div>
{scripts}
</body>
</html>
)}
/>
));
export default createHandler(() => (
<StartServer
document={({ assets, children, scripts }) => (
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
{assets}
</head>
<body>
<div id="app">{children}</div>
{scripts}
</body>
</html>
)}
/>
));
app.tsx
return (
<Router component={props => (
<MetaProvider>
<Title>Test Title</Title>
{props.children}
</MetaProvider>
)}>
<Route path='/test' component={TestPage}>
</Router>
)
return (
<Router component={props => (
<MetaProvider>
<Title>Test Title</Title>
{props.children}
</MetaProvider>
)}>
<Route path='/test' component={TestPage}>
</Router>
)
testpage.tsx
const [ data ] = createResource<FetchResponse>(() => params.id, fetchData, { deferStream: true });

return (
<>
<Show when={data()}>
<Title>{data().name}</Title>
<Meta name="description" content={data().description} />
</Show>
<>
)
const [ data ] = createResource<FetchResponse>(() => params.id, fetchData, { deferStream: true });

return (
<>
<Show when={data()}>
<Title>{data().name}</Title>
<Meta name="description" content={data().description} />
</Show>
<>
)
16 replies
SSolidJS
Created by Christian on 1/7/2025 in #support
SolidStart Meta not updating
They're not overriding one another, they're all staying in the head and it's random which one displays is the issue.
16 replies
SSolidJS
Created by Christian on 1/7/2025 in #support
SolidStart Meta not updating
This issue occurs also for my titles which I don't think would be caused by that, though, that would've been an issue regardless just I didn't get to it yet. Infact nothing gets overwritten, they all persists. The titles, links, descriptions, etc.
16 replies
SSolidJS
Created by Christian on 12/1/2024 in #support
Redirect in createResource
I use the catchall with "*404" then redirect to /404
22 replies
SSolidJS
Created by Christian on 12/1/2024 in #support
Redirect in createResource
I wanted it to redirect though.
22 replies
SSolidJS
Created by Christian on 12/1/2024 in #support
Redirect in createResource
I might go look into the internals of it later
22 replies
SSolidJS
Created by Christian on 12/1/2024 in #support
Redirect in createResource
Ahh interesting.
22 replies
SSolidJS
Created by Christian on 12/1/2024 in #support
Redirect in createResource
No worries, regardless thanks for your help on solving it.
22 replies
SSolidJS
Created by Christian on 12/1/2024 in #support
Redirect in createResource
This is just for a catch-all route to redirect to /404 if they go to a unspecified or protected route. Guess it doesn't really matter too much if it's client vs ssr in fairness, but I just preferred it on the server.
22 replies
SSolidJS
Created by Christian on 12/1/2024 in #support
Redirect in createResource
Navigate runs on client though correct?
22 replies
SSolidJS
Created by Christian on 12/1/2024 in #support
Redirect in createResource
Yeah unsure, do you happen to know why it requires a cache/query for this by the way? Bit confused why it can't just run in a SSRed function
22 replies
SSolidJS
Created by Christian on 12/1/2024 in #support
Redirect in createResource
Works with create resource as well, not sure it matters here either way since it's just a throwaway to redirect
22 replies
SSolidJS
Created by Christian on 12/1/2024 in #support
Redirect in createResource
Might with cache but I swapped to createAsync as I was reading some other documentation, I'll try with createResource in a moment.
22 replies
SSolidJS
Created by Christian on 12/1/2024 in #support
Redirect in createResource
import { cache, createAsync, redirect } from '@solidjs/router';

const handleRedirect = cache(async () => {
'use server';

throw redirect('/404');
}, '');

export default function CatchAll() {
createAsync(() => handleRedirect(), { deferStream: true });

return (<></>);
}
import { cache, createAsync, redirect } from '@solidjs/router';

const handleRedirect = cache(async () => {
'use server';

throw redirect('/404');
}, '');

export default function CatchAll() {
createAsync(() => handleRedirect(), { deferStream: true });

return (<></>);
}
Got it to work when swapping to cache and createAsync. Thanks @brenelz
22 replies