Skip to content
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

Fix content render imports flow #6958

Merged
merged 1 commit into from
May 2, 2023
Merged

Fix content render imports flow #6958

merged 1 commit into from
May 2, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented May 2, 2023

Changes

In the astro:content-render-imports plugin, it calls getContentEntryModuleFromCache in the load hook, but the cache is only set in astro:content-imports's transform hook.

This causes this error to happen in tests sometimes. I'm not sure how it used to work before 😅

[astro:content-render-imports] Could not load /Users/bjorn/Work/oss/astro/packages/integrations/markdoc/test/fixtures/entry-prop/src/content/blog/entry.mdoc (imported by test/fixtures/entry-prop/src/content/blog/entry.mdoc?astroPropagatedAssets=true): Unable to render "/Users/bjorn/Work/oss/astro/packages/integrations/markdoc/test/fixtures/entry-prop/src/content/blog/entry.mdoc". Did you import this module directly without using a content collection query?

This seems to be caused by #6817 which changes the load to transform.

Testing

Existing tests should pass.

Docs

n/a. bug fix.

@changeset-bot
Copy link

changeset-bot bot commented May 2, 2023

🦋 Changeset detected

Latest commit: 923dc63

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label May 2, 2023
@bluwy bluwy requested a review from bholmesdev May 2, 2023 09:36
Copy link
Contributor

@bholmesdev bholmesdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks transfor the fix! May want to reconsider this cache entirely seeing how fragile this can be. It only exists for a specific Markdoc feature that's now achievable in userland

@bluwy bluwy merged commit 72c6bf0 into main May 2, 2023
@bluwy bluwy deleted the fix-markdoc-error branch May 2, 2023 15:21
@astrobot-houston astrobot-houston mentioned this pull request May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants