-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
fs.createWriteStream TypeError with new io.js v2.3.0 #1981
Comments
I will test this later today. |
It is indeed related to 353e26e.
|
True. |
Yep, they should fix this bug with |
Still, it might be sensible to add a work-around for that on the io.js side. |
Some other places:
|
mecano is not using the |
Ah, ok. And for |
Yes I understand that, but anyway a module that is using a callback to check for error is wrong. It should listen for the |
We may want to revert 353e26e. It should have landed on the |
@cjihrig I agree. Even though it is wrong (and useless) to pass anything other than an object to these functions, it is still a breaking change. |
But the PR also added this part:
so reverting it would break code relying on this new functionality... |
I suggest we could fix that instead. |
+ a deprecation message saying "hey, it shouldn't be a function after all". But if there are only 2 modules in npm relying on this, is it really worth it? |
@rlidwka, That's not the full list. it's just the list modules that I have found. And I have a single version of less than 1/3 of npm modules, and run Can we comment out that |
+1 on revert and land on |
@Fishrock123 That would break a feature that was already released in 2.3.0. |
-1 on revert. If revert this, we got the fs.createReadStream error again. #1412 This does not break compatible. We should check the arguments properly. |
@yosuke-furukawa brings up a good point – will more code break if we revert back to the original behavior than if we leave the change in? I suppose it boils down to: are more people erroneously passing strings to I am leaning towards patching the |
Please allow both rather than only reverting one (and breaking new functionality) or leaving it in (and breaking existing functionality). Since we know it'd break something, it'd be semver-major! |
Ridiculous solution: if they pass a callback then create a |
@trevnorris That would still be a breaking change. |
Maybe it would be better to just ignore everything except strings and objects as an options? |
-1: ignore We should know what is the expected behavior when user calls And we write the specification, we should follow the spec. we should not support the illegal function call. If this is breaking change, we already broke fs.createReadStream here. #635 #1412 |
Just my EUR .02 but the broken modules are broken because they are buggy. I don't see any reason to revert the change or add workarounds, just PR the offenders as a courtesy and move on. |
@bnoordhuis One module is already fixed, and @targos already filed a PR for the second one. Edit: mentioned the wrong person, fixed. Sorry. |
Yeah, I'm not so sure I like either also. |
Ok, as no one (including myself) seems to actually support the idea of handling this (wrong API usage by modules) on the io.js side, I am closing both #1982 and #1998 PRs and this issue. This is a bug in the module that is using the API in an incorrect and unsupported way. A pull request targeting If anyone of @nodejs/collaborators thinks that this should be reopened or that there needs to be more discussion on this matter, just leave a message here. |
@ChALkeR @bnoordhuis @cjihrig |
karma-runner/karma#1454
The text was updated successfully, but these errors were encountered: