Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Uncaught TypeError: Object [object Object] has no method 'on' #46

Closed
kellyselden opened this issue Sep 10, 2015 · 3 comments
Closed

Uncaught TypeError: Object [object Object] has no method 'on' #46

kellyselden opened this issue Sep 10, 2015 · 3 comments

Comments

@kellyselden
Copy link

I first started seeing this yesterday on PR's to ember-cli. They all have this error:

Acceptance: ember install installs addons via npm and runs generators:
     Uncaught TypeError: Object [object Object] has no method 'on'
      at FileReader._getStream (node_modules/bower/node_modules/fstream/lib/file-reader.js:41:10)
      at FileReader._read (node_modules/bower/node_modules/fstream/lib/file-reader.js:99:17)
      at go (node_modules/bower/node_modules/fstream/lib/reader.js:214:21)
      at go (node_modules/bower/node_modules/fstream/lib/reader.js:217:7)
      at go (node_modules/bower/node_modules/fstream/lib/reader.js:217:7)
      at go (node_modules/bower/node_modules/fstream/lib/reader.js:217:7)
      at statCb (node_modules/bower/node_modules/fstream/lib/reader.js:218:7)
      at Object.oncomplete (fs.js:108:15)

Perhaps it coincides with your recent release? Maybe an issue with the graceful-fs major version bump?

@stefanpenner
Copy link

Turns out, this appears is the result of TWO libs both patching FS. GracefulFS and https://github.com/stefanpenner/fs-monitor-stack

Quick fix is to disable fs-monitor-stack unless its required (should have been the case anyways)

Relevant commit

@othiym23
Copy link
Contributor

Just so everyone knows, we're in the process of upgrading graceful-fs everywhere within npm, because future versions of Node (Node 5+) are probably going to use the internal bindings in an incompatible way that will break code trying to monkeypatch the fs code the old way (i.e. by using process.binding()). See also nodejs/node#2714 for one example of how this change might be made, but there are others.

I'm going to close this as not an issue in fstream, and in any case one that is addressed now by having switched to graceful-fs@4 in the latest version of fstream.

@stefanpenner
Copy link

@othiym23 sounds good. I'm still waiting on CI, but I am fairly confident it was the double monkey patching of FS modules that caused grief. Ultimately our patching was only to instrument for performance testing, and was only accidentally left always enabled.

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

3 participants