russellchoudhury
russellchoudhury
SSolidJS
Created by russellchoudhury on 10/20/2024 in #support
Can I nest cache functions
Just skimmed through the cache source code and there is a bunch of isServer logic. I would imagine from this that nested cache calls should work fine. Unless im missing something here https://github.com/solidjs/solid-router/blob/main/src/data/cache.ts
7 replies
SSolidJS
Created by russellchoudhury on 10/20/2024 in #support
Can I nest cache functions
so cache is only useful when called from the frontend? What is a good way to refactor the above, auth function in particular which needs to be called in almost every server function
7 replies
SSolidJS
Created by russellchoudhury on 10/10/2024 in #support
Random Crashes when redirecting via middleware
also for me 90% of my issues has been with the middleware, anyone else has this issue? I'm thinking of stripping out all my middleware logic
4 replies
SSolidJS
Created by russellchoudhury on 10/10/2024 in #support
Random Crashes when redirecting via middleware
These crashes sometime happen and at other times do not
4 replies
SSolidJS
Created by russellchoudhury on 9/3/2024 in #support
SSG/SSR on specific paths for landing page
ty @ryansolid 😄
20 replies
SSolidJS
Created by russellchoudhury on 9/3/2024 in #support
SSG/SSR on specific paths for landing page
yep that fixed it, setting ssr: true and now getting prerendered html
20 replies
SSolidJS
Created by russellchoudhury on 9/3/2024 in #support
SSG/SSR on specific paths for landing page
Here is the dist/index.html
20 replies
SSolidJS
Created by russellchoudhury on 9/3/2024 in #support
SSG/SSR on specific paths for landing page
Okay I just started a new project and get the same issue 1. pnpm create solid (all defaults, basic template) & pnpm i 2. app.config.ts
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
server: {
preset: "cloudflare-pages",
rollupConfig: {
external: ["__STATIC_CONTENT_MANIFEST", "node:async_hooks"],
},
prerender: {
crawlLinks: true,
routes: ["/"],
},
},
ssr: false,
});
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
server: {
preset: "cloudflare-pages",
rollupConfig: {
external: ["__STATIC_CONTENT_MANIFEST", "node:async_hooks"],
},
prerender: {
crawlLinks: true,
routes: ["/"],
},
},
ssr: false,
});
3. pnpm run build
20 replies
SSolidJS
Created by russellchoudhury on 9/3/2024 in #support
SSG/SSR on specific paths for landing page
code on the page is just
export default function App() {
return <main class="">This is the landing page</main>
}
export default function App() {
return <main class="">This is the landing page</main>
}
and in _build/assets i get the output
import{t}from"./web-BEH-7EHV.js";import"./solid-DHyVP8r9.js";var a=t('<main class="">This is the landing page');function i(){return a()}export{i as default};
import{t}from"./web-BEH-7EHV.js";import"./solid-DHyVP8r9.js";var a=t('<main class="">This is the landing page');function i(){return a()}export{i as default};
there's no html with This is the landing page in the build folder
20 replies
SSolidJS
Created by russellchoudhury on 9/3/2024 in #support
SSG/SSR on specific paths for landing page
just tested without the middleware and still not rendering HTML in the build
20 replies
SSolidJS
Created by russellchoudhury on 9/3/2024 in #support
SSG/SSR on specific paths for landing page
guess i can wrap the whole app in import { clientOnly } from "@solidjs/start"; ??
20 replies
SSolidJS
Created by russellchoudhury on 9/3/2024 in #support
SSG/SSR on specific paths for landing page
if thats the case how do i enable ssr but have it disabled for my /app route
20 replies
SSolidJS
Created by russellchoudhury on 9/3/2024 in #support
SSG/SSR on specific paths for landing page
maybe i'm misunderstanding what prerendering does? I thought it would build static html but it seems to just give you javascript/solid code?
20 replies
SSolidJS
Created by russellchoudhury on 9/3/2024 in #support
SSG/SSR on specific paths for landing page
I have the files index.html, index.html.br, index.html.gz in dist/ when i run vinxi build however the html has no static content within
20 replies
SSolidJS
Created by russellchoudhury on 9/3/2024 in #support
SSG/SSR on specific paths for landing page
how do i confirm/test its building correctly? I only see js files from the build output
20 replies
SSolidJS
Created by russellchoudhury on 8/26/2024 in #support
"use server" working locally but not when deployed
but i am sure i removed the middleware before and still had issues 🤷‍♂️ working now, hopefully i don't get any other issues like this because I really don't want to switch back to nextjs :L
16 replies
SSolidJS
Created by russellchoudhury on 8/26/2024 in #support
"use server" working locally but not when deployed
adding && !pathname.startsWith('/_server') fixed this issue
16 replies
SSolidJS
Created by russellchoudhury on 8/26/2024 in #support
"use server" working locally but not when deployed
I think it would cause an infinite redirect loop which wouldn't happen when SSR is on
16 replies
SSolidJS
Created by russellchoudhury on 8/26/2024 in #support
"use server" working locally but not when deployed
When SSR was false then this line would break things in the middleware
// Check user registration status and redirect if necessary
if (!pathname.startsWith('/auth/register') && !auth?.user.isRegistered) {
return sendRedirect(`/auth/register`, 302)
}
// Check user registration status and redirect if necessary
if (!pathname.startsWith('/auth/register') && !auth?.user.isRegistered) {
return sendRedirect(`/auth/register`, 302)
}
16 replies
SSolidJS
Created by russellchoudhury on 8/26/2024 in #support
"use server" working locally but not when deployed
well it was broken on the 26th and fixed on the 27th 😂 ... My middleware seemed to have caused some issues, maybe that was caching when i was debugging
16 replies