You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered: