https://codesandbox.io/s/github/manniL/nuxt-4301-custom-watchers-no-nuxt-config-update/tree/master/
Changes are correctly applied
Changes aren't applied correctly
@manniL adding this to my queue for the weekend, thanks.
In my case this also impacts the server middleware which were supposed to be hot reloaded by https://github.com/nuxt/nuxt.js/pull/3718 right?
@alex88 Could be affected, yup
Even after https://github.com/nuxt/nuxt.js/pull/4470 still present.
Updated CSB to latest nuxt-edge
try this on packege.json
"scripts": {
"dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server --watch api",
...
Jsut add --watch api
Is there any update on this? Restarting the entire nuxt server when modifying one single server middleware file is not ideal.
@Capu-zennio it's WIP ;)
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as 馃晲Pending
will not be automatically marked as stale.
Any estimate on when this will be included? Debugging express middleware is kind of annoying at the moment. Would be amazing if this could be fixed soon!
Restarting the Nuxt server doesn't re-import the serverMiddleware files, i.e. these are imported once upon invoking nuxt with requireModule
in core. I'm guessing that changing this behaviour is not quite obvious, as we'd have to restart the server while also dealing with require.cache and such.
Who has a solution for this ? with v2.8.1 , I still have the problem , my express serverMiddleware is wrongly reloaded.
I am also facing the same problem, @weskhaled I tried adding the watch api in my package.json but no change occurs.
Change this:
"scripts": {
"dev": "nuxt",
},
to this:
"scripts": {
"dev": "nodemon --watch api --exec nuxt",
},
I was having this issue too and I realized when reading the input on startup:
[nodemon] watching: <path to project>/api/**/*
, so I needed to adjust it to find the sub-folder
<path to project>/app/api/
or by using **/api/
.
So my package.json
for dev became:
"cross-env NODE_ENV=development nodemon server/index.js --watch server --watch **/api/"
Not sure if this is something else anyone encountered so i figured I would share it. (Cause sometimes even when we read the terminal output we don't realize these silly things..)
Edit: I recently realized I didn't need my server file and also swapped to TS so am now using nuxt-ts
, this is my new dev
script:
"cross-env NODE_ENV=development nodemon --exec 'nuxt-ts' --experimental-modules --watch **/api/"
Hello @galvez, is there any updates about this issue? Mine seems to be related: https://github.com/nuxt/nuxt.js/issues/6444
Only difference that I use nuxt-ts instead of nodemon, as recommended in docs
Thanks.
Possibly fixed in v2.10
by #6490
I've tested all the versions of Nuxt above 2.10 and it works as it expected.
Most helpful comment
@Capu-zennio it's WIP ;)