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
Today I used patch-package to patch @nuxt/image@1.3.0 for the project I'm working on.
When a provider depends on the runtime configuration, the current suggested approach is to use useRuntimeConfig, but this often throws the error [nuxt] [request error] [unhandled] [500] [nuxt] A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function. This is probably not a Nuxt bug. Find out more at https://nuxt.com/docs/guide/concepts/auto-imports#vue-and-nuxt-composables because getImage may be called outside of a composable/setup function. Would it be possible to instead add the runtime configuration to the ctx argument or provide another mechanism of using the runtime configuration in a provider?
Hi! 馃憢
Firstly, thanks for your work on this project! 馃檪
Today I used patch-package to patch
@nuxt/image@1.3.0
for the project I'm working on.When a provider depends on the runtime configuration, the current suggested approach is to use
useRuntimeConfig
, but this often throws the error[nuxt] [request error] [unhandled] [500] [nuxt] A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function. This is probably not a Nuxt bug. Find out more at https://nuxt.com/docs/guide/concepts/auto-imports#vue-and-nuxt-composables
becausegetImage
may be called outside of a composable/setup function. Would it be possible to instead add the runtime configuration to thectx
argument or provide another mechanism of using the runtime configuration in a provider?Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: