nuxt-community / composition-api

Composition API hooks for Nuxt 2.
https://composition-api.nuxtjs.org
MIT License
709 stars 100 forks source link

fix: using `useFetch` breaks raise undefined error on 404 page #554

Open farnabaz opened 3 years ago

farnabaz commented 3 years ago

🐛 The bug When using useFetch composable inside setup function will raise undefined error when navigating to 404 page.

I think this might be related to generating fetchKey

🛠️ To reproduce This issue only happens in static website, Steps to reproduce the behavior:

  1. Clone https://github.com/nuxt/nuxtjs.org/tree/32f6498640d0cb99772a70fc8cf27477351ad767
  2. yarn generate
  3. yarn start
  4. Go to /404 page and check web console

🌈 Expected behaviour

Evaluating fetch hook without raising an error.

kilobyte2007 commented 2 years ago

This is an issue for me too, any progress here?

Are there plans to fix this in the 2.* I might be willing to help with a PR if someone points me in the right direction.