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

Cannot use external content for rendering #2822

Open
itpropro opened this issue Oct 22, 2024 · 0 comments
Open

Cannot use external content for rendering #2822

itpropro opened this issue Oct 22, 2024 · 0 comments

Comments

@itpropro
Copy link
Contributor

Environment

I try to create a simple plugin to display GitHub gists in a code block based on a gist URL. Due to multiple issues with the MDC component inside of a Markdown component and as I need it to already be embedded in the static content, I decided to create a plugin for that.
Unfortunately, as soon as there is a async ofetch request in the plugin, the file body is no longer updated. It is probably because of Nitro not supporting async plugins (@pi0 ?).

What is the current recommended way to add external content to your content files. There a many scenarios besides embedding GitHub gist code, where this would be helpful/necessary.

Reproduction

https://stackblitz.com/edit/nuxt-content-repro?file=server%2Fplugins%2Fcontent.ts

Commenting the async call out (line 18-21) makes it work. Also delete the content-cache and cache folder under .nuxt.

Describe the bug

Cannot request external content in content hook.

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant