Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server restart / watch assets not working with non-ts files. #1136

Closed
rbutera opened this issue Apr 19, 2021 · 1 comment
Closed

Server restart / watch assets not working with non-ts files. #1136

rbutera opened this issue Apr 19, 2021 · 1 comment

Comments

@rbutera
Copy link

rbutera commented Apr 19, 2021

I'm submitting a...

[x] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request

Current behavior

Setting watchAssets to true and specifying assets to watch does not work anymore.

No matter what the file type, editing and saving the file does not result in a server reload/restart.

Expected behavior

watchAssets should work

Minimal reproduction of the problem with instructions

https://github.com/rbutera/nest-oso-repro

Try running yarn start:dev and then editing src/foo/rules/foo.polar and saving. Nothing changes.

You can change the file extensions and it's the same problem.

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

For example, the authorization framework Oso uses .polar files for authorization rule definitions. It is a poor developer experience having to manually restart the server every time you change a rule in order to test it.

Environment


 _   _             _      ___  _____  _____  _     _____
| \ | |           | |    |_  |/  ___|/  __ \| |   |_   _|
|  \| |  ___  ___ | |_     | |\ `--. | /  \/| |     | |
| . ` | / _ \/ __|| __|    | | `--. \| |    | |     | |
| |\  ||  __/\__ \| |_ /\__/ //\__/ /| \__/\| |_____| |_
\_| \_/ \___||___/ \__|\____/ \____/  \____/\_____/\___/


[System Information]
OS Version     : macOS Big Sur
NodeJS Version : v14.12.0
YARN Version    : 1.22.0

[Nest CLI]
Nest CLI Version : 7.5.4

[Nest Platform Information]
@nestjsx/crud-request version : 4.6.2
@nestjsx/crud-typeorm version : 4.6.2
platform-socket.io version    : 7.6.8
platform-express version      : 7.6.8
@nestjsx/crud version         : 4.6.2
websockets version            : 7.6.8
passport version              : 7.1.5
schedule version              : 0.4.1
typeorm version               : 7.1.5
common version                : 7.6.8
config version                : 0.6.3
core version                  : 7.6.8
cqrs version                  : 7.0.1
@kamilmysliwiec
Copy link
Member

This feature works as expected. watchAssets will automatically propagate changes to the dist folder, but it won't reload your application. I do understand that in your specific case it may make things somewhat more complicated, but at the same time, there are also a lot of use-cases when reloading app automatically would actually make things even more complicated. We discussed this in the past and we eventually decided to not trigger app reload ootb. Still, there are ways to make it work automatically in your case with webpack + custom file loader.

Anyways, please, use our Discord channel (support) for further questions as we are using GitHub to track bugs, feature requests, and potential improvements.

@nestjs nestjs locked and limited conversation to collaborators Apr 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants