Xyphyn / photon

A replacement for lemmy-ui with more features, a better design, and more customizability.
https://phtn.app
GNU Affero General Public License v3.0
348 stars 39 forks source link

SSR mode broken due to: TypeError: Cannot read properties of undefined (reading 'data') #378

Closed prezmix closed 1 month ago

prezmix commented 1 month ago

Describe the bug The feat: rewrite post feed fetching commit breaks SSR mode.

To Reproduce (if applicable) Steps to reproduce the behavior:

  1. Enable SSR mode (PUBLIC_SSR_ENABLED=true)
  2. Refresh main page and get
  3. See "500 Internal Error"
TypeError: Cannot read properties of undefined (reading 'data')
    at Module.postFeed (/photon/src/lib/lemmy/postfeed.ts:54:32)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async load (/photon/src/routes/+page.ts:17:10)
    at async Module.load_data (/photon/node_modules/@sveltejs/kit/src/runtime/server/page/load_data.js:192:17)
    at async eval (/photon/node_modules/@sveltejs/kit/src/runtime/server/page/index.js:168:13)

Expected behavior SSR mode should also work.

Versions