NuxtN
Nuxt3y ago
Pin 8

Modifying code in a composable throws error 500 composable is not defined

Hi all, i'm writing a composable on a nuxt 3 module.

*Problem

When I compile the app for the first time the composable work pretty good, but when I change code inside composable and hot reload acts the app throws an error 500 saying that my composable is not defined.

Then i need to restart the app compiling again and all works perfect again.

  • Minimal reproduction
Here I provide a minimal reproduction to that error, you could try defining a variable or add/remove a console.log and you should see the error.

https://stackblitz.com/edit/github-1hay52?file=composables%2FuseNetwork.js

I also checked that is there a post in stackoverflow but no solutions was provided.

https://stackoverflow.com/questions/75942987/nuxt-3-code-change-in-composable-generates-referenceerror/76497211?noredirect=1#comment134880834_76497211

Any ideas of what i'm doing wrong or missing?
Stack Overflow
Introduction
I am using nuxt for some small university projects, but I mention something that is quite anoying, but I could not find any ticket on the Nuxt 3 github or any mention on stackoverflow.
Was this page helpful?