Nest: Nest.js framework hot reload doesn't work

Created on 1 Nov 2018  Â·  3Comments  Â·  Source: nestjs/nest

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

I've just followed the steps of the documentation you have defined in the following link:

https://docs.nestjs.com/techniques/hot-reload

I'm running this command: npm run webpack but it closes, it returns me the prompt and it doesn't stay watching the files.

Therefore, whenever I add my *.ts files changes and they aren't being reloaded until the server restarts.

Expected behavior

It should stay watching my *.ts files changes and if I make a change if I reuse my API the changes should be reflected there without restarting the server.

Minimal reproduction of the problem with instructions

gabriel@roraima-tv:/var/www/studying/tera-ping-pong$ npm run webpack

    > [email protected] webpack /var/www/studying/tera-ping-pong
    > webpack --config webpack.config.js


    webpack is watching the files…

    Hash: 6e13d56ba7d77331e5c2
    Version: webpack 4.23.1
    Time: 3014ms
    Built at: 11/01/2018 1:39:11 PM
                       Asset       Size  Chunks             Chunk         Names
    dist/app.controller.d.ts  177 bytes          [emitted]  
        dist/app.module.d.ts   35 bytes          [emitted]  
       dist/app.service.d.ts   56 bytes          [emitted]  
              dist/main.d.ts   11 bytes          [emitted]  
          dist/main.hmr.d.ts   11 bytes          [emitted]  
                   server.js     39 KiB    main  [emitted]  main
    Entrypoint main = server.js
    [0] multi webpack/hot/poll?1000 ./src/main.hmr.ts 40 bytes {main}         [built]
    [./node_modules/webpack/hot/log-apply-result.js]         (webpack)/hot/log-apply-result.js 1.27 KiB {main} [built]
    [./node_modules/webpack/hot/log.js] (webpack)/hot/log.js 1.11 KiB         {main} [built]
    [./node_modules/webpack/hot/poll.js?1000] (webpack)/hot/poll.js?        1000 1.15 KiB {main} [built]
    [./src/app.controller.ts] 1.44 KiB {main} [built]
    [./src/app.module.ts] 1.03 KiB {main} [built]
    [./src/app.service.ts] 883 bytes {main} [built]
    [./src/main.hmr.ts] 1.07 KiB {main} [built]
    [@nestjs/common] external "@nestjs/common" 42 bytes {main} [built]
    [@nestjs/core] external "@nestjs/core" 42 bytes {main} [built]
gabriel@roraima-tv:/var/www/studying/tera-ping-pong$

What is the motivation / use case for changing the behavior?

In the development process being restarting the server is not good to the productivity.

Environment


Nest version: 5.1.0

For Tooling issues:
- Node version: 10.13.0
- Platform:  Linux Ubuntu 18.04

Others:

Most helpful comment

This is not a bug, but a feature request.
Nest itself doesn't support HMR, as it doesn't apply changes, but simply restarts the server as you can see.

All 3 comments

This is not a bug, but a feature request.
Nest itself doesn't support HMR, as it doesn't apply changes, but simply restarts the server as you can see.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

menme95 picture menme95  Â·  3Comments

cojack picture cojack  Â·  3Comments

hackboy picture hackboy  Â·  3Comments

2233322 picture 2233322  Â·  3Comments

rlesniak picture rlesniak  Â·  3Comments