You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
Description
Builders are a common pattern used by developers on different use-cases: https://refactoring.guru/design-patterns/builder
The watcher's default ignore pattern is containing build which cause the watcher to ignore all the paths with build in them. In my case the problem went even further since my app name is xy-builder and during troubleshooting I've found out that the watcher.getWatched() will return with an empty object every time and the hot reload won't work at all.
Steps to Reproduce
Init
#!/bin/bash
mkdir testcdtest
npm init
npm i fastify-cli
npx fastify-cli generate any-builder
cd any-builder
npm i
Add logging to debug
Under node_modules/fastify-cli/lib/watch open the index.js file
Add console.log(watcher.getWatched()) to ln 83 (or under watcher.on('ready', function () {
Save the file
Reproduce error
Run npm run dev
See that the console.log() output will be {}
Screenshots:
The buggy behaviour
2. Temporary removed the build from the default ignoreWatch by hardcoding the defaults into `start.js` to showcase the expected results
Expected Behavior
I think the expected behaviour here should be a match for build exactly. I'm a newbie to Fastify tho so I'm not sure where build folder will be important since as far as I see so far the ts build's default destination is dist/ as well. If we are not using build folders on a purpose I think maybe we could remove it from the default ignores at all but please let me know about your thoughts on this topic.
The text was updated successfully, but these errors were encountered:
Prerequisites
Description
Builders are a common pattern used by developers on different use-cases: https://refactoring.guru/design-patterns/builder
The watcher's default ignore pattern is containing
build
which cause the watcher to ignore all the paths withbuild
in them. In my case the problem went even further since my app name isxy-builder
and during troubleshooting I've found out that thewatcher.getWatched()
will return with an empty object every time and the hot reload won't work at all.Steps to Reproduce
Init
Add logging to debug
node_modules/fastify-cli/lib/watch
open theindex.js
fileconsole.log(watcher.getWatched())
to ln 83 (or underwatcher.on('ready', function () {
Reproduce error
npm run dev
console.log()
output will be{}
Screenshots:
Expected Behavior
I think the expected behaviour here should be a match for build exactly. I'm a newbie to Fastify tho so I'm not sure where
build
folder will be important since as far as I see so far the ts build's default destination isdist/
as well. If we are not using build folders on a purpose I think maybe we could remove it from the default ignores at all but please let me know about your thoughts on this topic.The text was updated successfully, but these errors were encountered: