Can't access innerJoin result in page data using Svelte
In src/routes/+layout.server.ts I have this load function, which returns postTags via a Drizzle query to my Supabase Postgres DB. It's successfully returning a result which I'm able to log to my console.
However, I am unable to access the property via export let data or $page.data on child pages. Strangely, the other properties returned from my load functions are made accessible fine. I don't have any load functions that override the returned postTags in this server load function.
Why could this be? I can't figure it out and since the other properties are returning fine, I doubt it's a Svelte issue. I'm not getting any typescript errors either. So I suspect it may be something related to the ORM. Thanks!
Relevant code:
https://github.com/brucey0x/bv_markdown_blog/blob/ebe102f5a4713443d5b2e8e1c1a77cad6b88403c/src/routes/%2Blayout.server.ts
https://github.com/brucey0x/bv_markdown_blog/blob/ebe102f5a4713443d5b2e8e1c1a77cad6b88403c/src/app.d.ts
GitHub
bv_markdown_blog/src/routes/+layout.server.ts at ebe102f5a4713443d5...
Personal blog with Markdown posts hosted in external database. Supabase for Postgres, Auth, Storage with Drizzle ORM, Shadcn-Svelte, Tailwind CSS. - brucey0x/bv_markdown_blog
GitHub
bv_markdown_blog/src/app.d.ts at ebe102f5a4713443d5b2e8e1c1a77cad6b...
Personal blog with Markdown posts hosted in external database. Supabase for Postgres, Auth, Storage with Drizzle ORM, Shadcn-Svelte, Tailwind CSS. - brucey0x/bv_markdown_blog
2 Replies
Sounds like a possible issue with the Svelte language server not updating types automatically in the background. Try the restarting the Svelte language server.
Ctrl/Cmd + Shift + P
> Svelte
Thanks. I thought so too but restarting the TS or Svelte language servers isn't resolving the issue.
Any idea what else it could be?
Ah I found the issue. While it was being returned from
layout.server.ts
I wasn't passing it to the client in layout.ts
. Thanks for your help everyone.