BetterTyped / hyper-fetch

⚡ Fetching and realtime data exchange framework.
https://hyperfetch.bettertyped.com/
Apache License 2.0
1.03k stars 28 forks source link

Nuxt 3 `default is not a constructor` #42

Closed johngerome closed 1 year ago

johngerome commented 1 year ago

Describe the bug Related to https://github.com/BetterTyped/hyper-fetch/issues/37

I still getting default is not a constructor. Example here https://stackblitz.com/edit/hyperfetch-nuxt-demo?file=pages%2Findex.vue Updated the hyper-fetch to 3.3.0 Any idea ? Any help would be much appreciated. Thank you.

To Reproduce Steps to reproduce the behavior:

  1. Go to hyperfetch-nuxt-demo
  2. See error on the preview

Expected behavior No error should happen.

Screenshots see hyperfetch-nuxt-demo

Desktop (please complete the following information): N/A

Smartphone (please complete the following information): N/A

Additional context N/A

prc5 commented 1 year ago

@johngerome Found the issue! I see that Nuxt is not providing "events" node module. When I added it as dependency like: `'events': '3.3.0' it worked. I will add it as dependency for such cases. You can try it out by adding it there, I will deploy fix today or tomorrow with this dependency.

Thanks for the support!

johngerome commented 1 year ago

@johngerome Found the issue! I see that Nuxt is not providing "events" node module. When I added it as dependency like: `'events': '3.3.0' it worked. I will add it as dependency for such cases. You can try it out by adding it there, I will deploy fix today or tomorrow with this dependency.

Thanks for the support!

@prc5 It worked as well on my end 🥳. Thank you so much.

prc5 commented 1 year ago

@johngerome Update is out 👍🏻 I'm looking forward to some feedback! 😄 If you have any ideas for improvements for better implementation with Vue/Nuxt let me know. Thanks!