-
Notifications
You must be signed in to change notification settings - Fork 37
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
Buggy async behavior... #40
Comments
This sounds like an issue with docco to me. We're using passing the only callback function supported by the docco API so it appears that docco is invoking that function prematurely. From what I remember though (and this could be wrong or out-of-date), docco copies the assets over "lazily"; that is, it doesn't really care if the copy has fully completed or not. In this case the docco command line will remain active as the copy async copy is keeping it alive and then ends once it's completed. However, we're using the API so can only consider it done if/when the callback is invoked. The best solution would be for this to be fixed in docco but, in theory, we could spawn a child process and invoke docco that way. This would hopefully result in us being notified of completion only once that process has ended. However, this is clunky and will have other headaches as we'd then have command length limitations (imagine large projects and full path lengths) etc. |
Very interesting. Let me play with it. Though the 500ms is certainly only hiding the issue; the setTimout itself still gets set before docco finishes. |
The copy operation is from Nothing in either indicates to me why they'd be calling the callback early, and all look like they handle errors well (so any that occur should bubble to grunt.async()). |
Interesting. I actually think I may have even been the one that fixed the issue I was describing, it was a long time ago now. Can you confirm what version of docco you have in the |
As expected, version 0.6.3. I'm no nodejs expert, but is there a way to dump its async queue (pending async operations)? This would help a lot with understanding what's going on... |
FWIW, I think I'm onto something. Looks like a bug in fs-extra or one of its dependencies:
Looks like it's time to open an issue on fs-extra. |
Issue opened: jprichardson/node-fs-extra#98. |
Also opened an issue with Docco, looks like they could put a workaround in place. jashkenas/docco#319 |
Hi,
IMO this looks like a bug in docco or maybe even grunt, but it only appears when using grunt-docco, so here am I...
Oddly, using grunt-docco sometimes results in incomplete or missing resource files.
A working example
package.json
Gruntfile.js
src.js
The problem
(Grunt output stripped for the sake of clarity)
normalize.css
is either correctly written, empty, or missing...And as the same stuff happens in
docs/public/fonts/
, using grunt-docco in a watch task gives what I would call a funny "random layout" effect!Well, this definitely looks like an async issue.
Indeed, in
grunt-docco/tasks/docco.js
, turning:into an ugly:
solves the issue.
Any ideas?
The text was updated successfully, but these errors were encountered: