gruntjs / gruntjs/grunt

watchtask callback not firing for the very first time

Open
#1,765 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.2k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

I have written a custom task as a callback for watch(grunt-contrib-watch).

During the very first time when i edit and save the file, the custom task is not called. But from the second time the custom task is getting called correctly.

Also facing such callback anomalies during watch persisting for long time.

Debugged some files but doesn't get a clear picture about that.

grunt-contrib-watch: "1.1.0"
grunt : "1.6.1"

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the callback behavior with grunt-contrib-watch 1.1.0 and grunt 1.6.1, focusing on the watch entry point and the first file save. Compare the first and later callback runs, including a long-running watch session; done means the callback fires reliably from the first change onward.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.