hannus
hannus
SSolidJS
Created by MaxLarionov0916 on 6/28/2024 in #support
Bug? with ssr, lazy loading, and css.
I have believed that this issue is a normal exception of DEV mode, beacuse It will okay when the project has built 😉
14 replies
SSolidJS
Created by Yifimitch on 6/24/2024 in #support
`bun create solid` takes long time to create a new project
what is your version of node? Try to update node although what you have tried is bun.
4 replies
SSolidJS
Created by hannus on 6/22/2024 in #support
Proper Usage of load() for Authentication and Redirection in Solid-Start
get it. I appreciate
18 replies
SSolidJS
Created by hannus on 6/22/2024 in #support
Proper Usage of load() for Authentication and Redirection in Solid-Start
Does const pathname = useLocation().pathname; make sense? Pathname variable has not been wrapped in the Cache.
18 replies
SSolidJS
Created by Rvespula on 6/17/2024 in #support
Redirect in production:
in the LoginForm() component, throw redirect based on a normal async function(handleSession). I believe that would be call once and hard to execute at the time you want.
14 replies
SSolidJS
Created by Rvespula on 6/17/2024 in #support
Redirect in production:
I think the reason is single data flow, so make sure the data that used in the component is a signal. Cache is a plus for enhancing performance.
14 replies
SSolidJS
Created by Rvespula on 6/17/2024 in #support
Redirect in production:
getPost() is the function cached:
typescript
export const getPost = cache(async () => {
"use server";
try {
const token = await getToken();
const post = await fetchPost(token);
return post;
} catch (error) {
throw redirect("/login");
}
}, "post");
typescript
export const getPost = cache(async () => {
"use server";
try {
const token = await getToken();
const post = await fetchPost(token);
return post;
} catch (error) {
throw redirect("/login");
}
}, "post");
I hope it is useful.
14 replies
SSolidJS
Created by Rvespula on 6/17/2024 in #support
Redirect in production:
I have similar issue last week. My solution is set up a cache which handles with the session in the router.load() at first, and create a resource by using createAsync to check whether the session works fine. In the Code as following:
export const route = {
load() {
void getPost();
}
} satisfies RouteDefinition;
export default function Hello() {
const post = createAsync(() => getPost(), {deferStream: true});
return (
<main>
<Title>Hello, this page needs auth</Title>
<h1>Hello</h1>
<p>
{post()}
</p>
</main>
);
export const route = {
load() {
void getPost();
}
} satisfies RouteDefinition;
export default function Hello() {
const post = createAsync(() => getPost(), {deferStream: true});
return (
<main>
<Title>Hello, this page needs auth</Title>
<h1>Hello</h1>
<p>
{post()}
</p>
</main>
);
14 replies
SSolidJS
Created by Rvespula on 6/17/2024 in #support
Redirect in production:
Can I have a look at the code of component that you want to redirect to?
14 replies
SSolidJS
Created by Rvespula on 6/17/2024 in #support
Redirect in production:
how about clear the cache and cookie before run the app?
14 replies
SSolidJS
Created by Rvespula on 6/17/2024 in #support
Redirect in production:
What has showed in the console?
14 replies
SSolidJS
Created by chirptune on 5/17/2024 in #support
Why is solid start dev site so heavy?
why not try to use Bun ? Bun is faster than NPM
4 replies
SSolidJS
Created by eponymous on 5/13/2024 in #support
Create route which opens a modal
I think <Show> component is a proper method to meet your demand. Based on the prop of When and the signal of showModal to control the Modal whether open or not.
15 replies
SSolidJS
Created by hannus on 4/7/2024 in #support
how to edit html attribute?
thanks. It clears.
4 replies
SSolidJS
Created by hannus on 4/5/2024 in #support
how to deal with flashes of unstyled content
oh, I know the key point that solidstart will deal with FOUC after build. I think in the dev mode( bun dev in terminal ), FOUS is a common scenario. Am I right?
3 replies
SSolidJS
Created by anhvu0911 on 10/19/2023 in #support
Loading CSS issue (FOUC) on optional parameter
code is here:
import "bulma/css/bulma.min.css";
import { Router } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
import { Suspense } from "solid-js";


import Nav from "./components/Nav";

export default function App() {
return (
<Router
root={(props) => (
<main>
<Nav />
<Suspense>
<div class="content">{props.children}</div>
</Suspense>
</main>
)}
>
<FileRoutes />
</Router>
);
}
import "bulma/css/bulma.min.css";
import { Router } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
import { Suspense } from "solid-js";


import Nav from "./components/Nav";

export default function App() {
return (
<Router
root={(props) => (
<main>
<Nav />
<Suspense>
<div class="content">{props.children}</div>
</Suspense>
</main>
)}
>
<FileRoutes />
</Router>
);
}
9 replies
SSolidJS
Created by anhvu0911 on 10/19/2023 in #support
Loading CSS issue (FOUC) on optional parameter
I am using bulma css, and imported it in App.css
9 replies
SSolidJS
Created by anhvu0911 on 10/19/2023 in #support
Loading CSS issue (FOUC) on optional parameter
hello, have you find the solution? I am encountered this problem. FOUC could be removed in the CSR mode, however, the same code in SSR mode unstyled content will be shown a while.
9 replies
SSolidJS
Created by hannus on 3/27/2024 in #support
[solved]Issue with Solid Start MDX Project: 404 Error for New Page
thanks a lot.
21 replies
SSolidJS
Created by hannus on 3/27/2024 in #support
[solved]Issue with Solid Start MDX Project: 404 Error for New Page
okay, problem be solved
21 replies