-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compiledContent() no longer working with getCollection() #10604
Comments
Content collection entries (of type "content") expose a const entry = /* content collection entry */;
const { Content } = await entry.render();
---
<Content /> |
Yes, I saw that in the docs, but AFAIK that doesn't give us the ability to get the rendered string value, which is what we need (same functionality of |
The closest I've been able to get with the new approach is This is too bad, it means we can't use the new If this changes, please let us know! |
*Looks like I found a workaround. I got the idea from this last section of the Markdown documentation to use the This approach technically works, but it comes with the downside that's mentioned in the documentation:
It also means (AFAIK), that MDX posts won't be rendered correctly. So still, ideally the |
Thanks for tracking this down and finding a workaround. At the moment, I think withastro/roadmap#419 is the best place to track this issue/feature. IIRC we had refactored how MDX was rendered, which while makes it more robust, introduces some caveats like this that can't be easily supported. Regarding the container API (that should help with this feature), we have that on the roadmap this quarter, so it's likely something to be explored soon. I'll close this issue for now. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Hi, I've been trying to upgrade our blog to use the latest version of Astro, but I've hit a serious snag.
The documentation recommends moving away from
Astro.glob
to usinggetCollection()
, and I've been diligently attempting to do this (especially since we have a blog post in the works on how to migrate from Wordpress to Astro).However, our blog depends on calls to
page.compiledContent()
to render article summaries as well as the RSS feed.The entries that are returned by
getCollection()
do not seem to have acompiledContent()
function on them.What to do? I've searched the issues and Discord and couldn't find anything on this. The closet thing seems to be this Container API proposal, but maybe I'm mistaken and that's unrelated to this issue.
See above. The "bug" is that there is no clear way to upgrade a blog that was previously working fine with Astro, and the documentation doesn't seem to help.
You can attempt to build the "minimal reproducible example" link with
npm run build
to seepage.compiledContent is not a function
error.What's the expected result?
For the documentation to clearly explain an alternative to using the
compiledContent()
function.Link to Minimal Reproducible Example
https://github.com/okTurtles/blog.okturtles.org/tree/update-deps
Participation
The text was updated successfully, but these errors were encountered: