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
{{ message }}
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
Similar to #264 now I'm running into an issue where a useFetch doesn't work inside onGlobalSetup callback, it fails because of null access to some properties on the vm
My use case is that I read some cookies from the req object and use fetch to pre-load some user-related data for SSR rendering.
🐛 The bug
Similar to #264 now I'm running into an issue where a
useFetch
doesn't work insideonGlobalSetup
callback, it fails because of null access to some properties on thevm
My use case is that I read some cookies from the
req
object and usefetch
to pre-load some user-related data for SSR rendering.Here is a snippet:
No need to do any fetching logic, just calling
useFetch
insideonGlobalSetup
callback is enough to trigger the error🛠️ To reproduce
setup.js
plugin file and add it tonuxt.config.js
Reproduction link:
https://codesandbox.io/s/hungry-torvalds-7nt86?file=/plugins/setup.js:0-182
🌈 Expected behaviour
useFetch
should work insideonGlobalSetup
, or if intended then it should be reflected in the documentation.ℹ️ Additional context
I'm working on a fix for this at the moment that works fine on my project, will send a PR once done!
The text was updated successfully, but these errors were encountered: