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

Profile media page is broken in SSR mode #387

Closed prezmix closed 1 month ago

prezmix commented 1 month ago

Describe the bug Thank you for fixing the last SSR issue (#378), seems I ran into another one on the Profile/Media page.

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

  1. Enable SSR mode (PUBLIC_SSR_ENABLED=true)
  2. Go to Profile -> "..." -> Media
  3. See "500 Internal Error"
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at Function.from (<anonymous>)
    at Module.ensure_array_like (/photon/node_modules/svelte/src/runtime/internal/each.js:9:11)
    at Module.each (/photon/node_modules/svelte/src/runtime/internal/ssr.js:111:10)
    at eval (/photon/src/routes/profile/media/+page.svelte:41:69)
    at Object.$$render (/photon/node_modules/svelte/src/runtime/internal/ssr.js:156:16)
    at Object.default (/photon/.svelte-kit/generated/root.svelte:61:44)
    at eval (/photon/src/routes/profile/+layout.svelte:126:45)
    at Object.$$render (/photon/node_modules/svelte/src/runtime/internal/ssr.js:156:16)
    at Object.default (/photon/.svelte-kit/generated/root.svelte:49:42)
    at Object.main (/photon/src/routes/+layout.svelte:145:13)

Expected behavior Media page should work in SSR mode.

Also noticed that refreshing Profile page (/profile/user) gives error: 400 {"error":"no_id_given"} when in SSR mode.

Screenshots If applicable, add screenshots to help explain your problem.

Versions

Xyphyn commented 1 month ago

I don't think any of the pages will work on an SSR load in the profile page, because authentication does not work server side, so what if I just made it so that specific group of pages is CSR only?

prezmix commented 1 month ago

Ah I see. I use custom OAuth authentication, but no worries it's not an important feature :)

Xyphyn commented 1 month ago

ssr was disabled for that layout only.