Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blog fails when SSR is enabled #192

Closed
jussi-photografi opened this issue Jul 2, 2023 · 1 comment
Closed

Blog fails when SSR is enabled #192

jussi-photografi opened this issue Jul 2, 2023 · 1 comment

Comments

@jussi-photografi
Copy link

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)
@jussi-photografi 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
@prototypa
Copy link
Contributor

Hi @jussi-photografi

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.

Thank you.

@onwidget onwidget locked and limited conversation to collaborators Jul 3, 2023
@prototypa prototypa converted this issue into discussion #194 Jul 3, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants