Hey folks! Hope to get some help with this weird issue. (FYI it won't make too much sense without looking at the linked github issue).
I've detailed a unique case here https://github.com/withastro/astro/issues/7317 where invoking an Astro component via a custom tag runs into issues with getEntry() and getEntryBySlug(). As explained in the OP of the issue, this only happens with a combination of factors involving content collections.
@vale sentinel intrepidly found that the issue was arising out of a memory issue in Vite, and suggested a workaround (https://github.com/withastro/astro/issues/7317#issuecomment-1581230856). It involves passing the function getEntry() inside a variable.
The workaround works fine when using the component as a custom Astro tag. I'd like to also invoke the component from ordinary Astro files as well, and that means having to use the same workaround—passing getEntry() into Astro.props inside an attribute, even though getEntry() is perfectly available to an ordinary Astro file. That gets annoying when having to keep passing it from endpoint to layout to component, to subcomponent, etc.
Here's a stackblitz that shows the complications the workaround causes: https://stackblitz.com/edit/github-pq3pgo-j623al?file=src%2Fpages%2F[...slug].astro
I'd like to just use the same component in both cases (Astro file and markdoc tag).
If anyone has any suggestions, I'd be very grateful!
What version of astro are you using? 2.6.0 Are you using an SSR adapter? If so, which one? None What package manager are you using? pnpm What operating system are you using? Mac What browser are yo...
