primocms / primo

Primo is a visual CMS with a built-in code editor, Svelte blocks, and static site generator.
https://primocms.org
MIT License
1.92k stars 474 forks source link

Cannot read properties of null (reading 'server_members') #314

Closed SpyrexDE closed 11 months ago

SpyrexDE commented 11 months ago

I just followed the tutorial for self hosting primo on vercel, however I get the following server side error when opening the deployed page:

TypeError: Cannot read properties of null (reading 'server_members')
    at file:///var/task/.svelte-kit/output/server/entries/pages/_layout.js:15:37
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async load (file:///var/task/.svelte-kit/output/server/entries/pages/_layout.js:10:37)
    at async load_data (file:///var/task/.svelte-kit/output/server/index.js:585:18)
    at async file:///var/task/.svelte-kit/output/server/index.js:1911:18
SpyrexDE commented 11 months ago

I just tried it again today and the error resolved itself. I'm not able to reproduce it anymore :/

mateomorris commented 11 months ago

@SpyrexDE okay, lemme know if it comes back up. I've noticed this too but it doesn't seem to cause any usability issues & it doesn't make sense to me. It's happening here because 'user' is coming up empty as if the user isn't authenticated, but if they're not authenticated it should redirect before that.

mateomorris commented 11 months ago

Okay did a big refactor to use the new Supabase SvelteKit helpers & this isn't happening anymore.