You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Project doesn't work when SSR is enabled (npm run astro add react + set output: 'server' in astro.config.mjs). I'm new to Astro and modern frontend development, so I'm a bit lost here -- will I be able to run things like next-auth and React code with my project built on AstroWind?
10:17:33 PM [getStaticPaths] getStaticPaths() in src/pages/[...blog]/[category]/[...page].astro is ignored when "output: server" is set.
error Cannot read properties of undefined (reading 'currentPage')
File:
/home/jussi/Projects/poc/astrowind_vanilla/src/pages/[...blog]/[category]/[...page].astro:35:26
Code:
> 35 | const currentPage = page.currentPage ?? 1;
| ^
36 | const meta = {
37 | title: `Category'${category}' ${currentPage > 1 ? ` — Page ${currentPage}` : ''}`,
38 | description: SITE.description,
Stacktrace:
TypeError: Cannot read properties of undefined (reading 'currentPage')
at /home/jussi/Projects/poc/astrowind_vanilla/src/pages/[...blog]/[category]/[...page].astro:35:26
at [...page] (/home/jussi/Projects/poc/astrowind_vanilla/node_modules/astro/dist/runtime/server/astro-component.js:19:12)
at renderPage (file:///home/jussi/Projects/poc/astrowind_vanilla/node_modules/astro/dist/runtime/server/render/page.js:96:36)
at renderPage (file:///home/jussi/Projects/poc/astrowind_vanilla/node_modules/astro/dist/core/render/core.js:109:24)
at renderPage (file:///home/jussi/Projects/poc/astrowind_vanilla/node_modules/astro/dist/core/render/dev/index.js:133:16)
at async handleRoute (file:///home/jussi/Projects/poc/astrowind_vanilla/node_modules/astro/dist/vite-plugin-astro-server/route.js:167:20)
at async run (file:///home/jussi/Projects/poc/astrowind_vanilla/node_modules/astro/dist/vite-plugin-astro-server/request.js:47:14)
at async runWithErrorHandling (file:///home/jussi/Projects/poc/astrowind_vanilla/node_modules/astro/dist/vite-plugin-astro-server/controller.js:65:5)
at async handleRequest (file:///home/jussi/Projects/poc/astrowind_vanilla/node_modules/astro/dist/vite-plugin-astro-server/request.js:41:3)
The text was updated successfully, but these errors were encountered:
jussi-photografi
changed the title
Cannot read properties of undefined (reading 'currentPage') when SSR is enabled
Blog fails when SSR is enabled
Jul 2, 2023
The theme is not intended to work on SSR. Just static for now. In a next version we will support SSR.
To make it work in SSR you will have to update several files yourself.
Anyway we will let you know when we have a version that with small changes allows SSR.
Project doesn't work when SSR is enabled (
npm run astro add react
+ setoutput: 'server'
inastro.config.mjs
). I'm new to Astro and modern frontend development, so I'm a bit lost here -- will I be able to run things like next-auth and React code with my project built on AstroWind?The text was updated successfully, but these errors were encountered: