russellchoudhury
russellchoudhury
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
SSolidJS
Created by russellchoudhury on 8/26/2024 in #support
"use server" working locally but not when deployed
ok now it works with ssr false??? so weird, i don't even know what changed 🤔
16 replies
SSolidJS
Created by russellchoudhury on 8/26/2024 in #support
"use server" working locally but not when deployed
because my tanstack form don't work when ssr is true 😂
16 replies
SSolidJS
Created by russellchoudhury on 8/26/2024 in #support
"use server" working locally but not when deployed
O okay, do you know why my code wasn't working when ssr is false?
16 replies
SSolidJS
Created by russellchoudhury on 8/26/2024 in #support
"use server" working locally but not when deployed
O, ssr: true seems to fix it... so i need ssr to run 'server actions'?
16 replies