Nuxt.js: Server middleware isn't hot reloading properly

Created on 20 Dec 2018  路  9Comments  路  Source: nuxt/nuxt.js

Version

v2.3.4

Reproduction link

https://github.com/henriqemalheiros/bug-report-nuxt-server-middleware-hot-reload

Steps to reproduce

  • Run yarn dev;
  • Open http://localhost:3000/api in your browser;
  • You'll see "api" appearing on the screen;
  • Open ~/api/index.js in your editor;
  • Change the fourth line to return res.end('api test');
  • Nuxt will refresh;
  • Open or refresh http://localhost:3000/api in your browser;
  • You'll still see "api" appearing on the screen;
  • Stop Nuxt;
  • Run yarn dev again;
  • Open or refresh http://localhost:3000/api in your browser;
  • You'll see "api test" appearing on the screen.

What is expected ?

You should see "api test" appearing on the screen without needing to stop Nuxt.

What is actually happening?

Nuxt is properly watching the files in ~/api but it's not reloading them.

Additional comments?

It seems that previously (#258 and #1819) we would use Nuxt alongside nodemon. But since v2.0.0 (#1509 and #3718), server middlewares have watchers support.

This bug report is available on Nuxt community (#c8334)
bug-report pending

Most helpful comment

@francoism90 I meant that the next minor release (v2.4) will likely not include a fix for this. I can't give an ETA or similar though.

Closing to unify the (almost same) issue in #4301

All 9 comments

Thanks for the report 鈽猴笍

See #4301. Will be fixed in a future version (not v2.4 though)

@manniL Just to confirm the same problem here.
What do you mean exactly with not in this version? Will this still be in Nuxtjs v2? :)

Thanks.

@francoism90 I meant that the next minor release (v2.4) will likely not include a fix for this. I can't give an ETA or similar though.

Closing to unify the (almost same) issue in #4301

Hi, year and a half later - is there any ETA on this issue? This significantly spoils development experience :)

@ruzpuz If I understand the issue rightly, yes, this is no longer an issue. I can't verify it though as the repro repository is now gone. Feel free to open a new issue if not 馃檪

Um.... yeah nah, but... It very much is an issue... Looks like half (not literally but the part I need) of the project is outside webpack and does not get hot-reloaded properly. You can try webpack aliases inside of server-middleware, and it is not working as well.. Quite a deal breaker for me, although the idea is superb... :(

@ruzpuz Please do submit a code reproduction and a new issue! :smiley:

Would a fork of the repository be okay? I am getting prepared to port the project away from nuxt, but before I do that I can fork the repo here so you can play with it if you like

@ruzpuz That would be perfect :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bimohxh picture bimohxh  路  3Comments

vadimsg picture vadimsg  路  3Comments

maicong picture maicong  路  3Comments

vadimsg picture vadimsg  路  3Comments

VincentLoy picture VincentLoy  路  3Comments