Skip to content
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

ReadStream: Cannot read property 'prototype' of undefined #109

Closed
dolanmiu opened this issue Mar 11, 2017 · 22 comments
Closed

ReadStream: Cannot read property 'prototype' of undefined #109

dolanmiu opened this issue Mar 11, 2017 · 22 comments

Comments

@dolanmiu
Copy link

I am getting this issue:

#70

On these lines:

https://github.com/isaacs/node-graceful-fs/blob/master/graceful-fs.js#L165-L166

var fs$ReadStream = fs.ReadStream // ReadStream is undefined!
ReadStream.prototype = Object.create(fs$ReadStream.prototype)

But I am NOT on Meteor. I am using Angular2

@danielbaak
Copy link

danielbaak commented Apr 3, 2017

I can confirm the issue.
Apparently fs contains only fs.FileReadStream (and fs.FileWriteStream) which may (?) be meant.

@Randagio13
Copy link

I have the same problem

@ernieyang09
Copy link

same here,using webpack2 & react

@lucas-t5
Copy link

+1 having this issue

@loperto
Copy link

loperto commented Jun 29, 2017

i have the same problem with react and webpack

@chackerian
Copy link

chackerian commented Jun 30, 2017

I have the same problem as well when trying to require mongodb.

fs does contain ReadStream

@optiguy
Copy link

optiguy commented Jul 2, 2017

I have the same problem with create-react-app

@Sl0w87
Copy link

Sl0w87 commented Jul 5, 2017

I have the same issue with a clean project that i created with create-react-app.
As i use chokidar in the App component i get this error on yarn start.

@lafiza
Copy link

lafiza commented Jul 18, 2017

+1 having same issue

@Sl0w87
Copy link

Sl0w87 commented Jul 19, 2017

Hi all,
i have fixed my issue.
The problem was, that i have created an electron app in that i used react.
If you want to use chokidar in this constelation, you must import ist with the following code:
const chokidar = window.require('chokidar');

Maybe anyone has the same constelation and problem.

@sjbwylbs
Copy link

i have same issue.
i have fixed my issue.

npm i chalk@2.0.1

it work fine.

i think it would help some one!

@medkhelifi
Copy link

I have the same problem;
React + Webpack 2
In webpack config, I added
node: { fs: 'empty' }
But the issue still remains.

@sjbwylbs
Copy link

@medkhelifi did't you try replace your chalk version to 2.0.1?

@gemma-ferreras
Copy link

gemma-ferreras commented Feb 5, 2018

I am having the same issue. Any updates? I used create-react-app and ejected it.

@genachka
Copy link

genachka commented Feb 7, 2018

+1

@sirentek
Copy link

using electron with nodejs.
same here..

updating chalk version to 2.0.1 => did not work for me.
updating chalk version to 2.3.1 => did not work for me either.

@dmftuva
Copy link

dmftuva commented Feb 21, 2018

with FS you are trying to get file from clients computer? fs must be used on back ) no webpack

@AnelaNuo
Copy link

AnelaNuo commented Jun 16, 2018

Dear Isaacs,
Could you close issues #121 and this after fixing this bug.
I tried to rewrite two last lines in your code in #121 by the pattern in my local node_modules and solved this problem in React app.
But I finded this precription for a long time, because no one issues not closed.

Best regards, Anela.

@spirosbax
Copy link

spirosbax commented Oct 7, 2018

Here is how I fixed it:

  • replace fs.ReadStream with fs.createReadStream in line 165,
  • replace fs.WriteStream with fs.createWriteStream in line 169,

this works because in the docs there are create methods for creating streams.

@rekmarks
Copy link

Issue not fully resolved on my end after applying @spirosbax's fix manually. See: #135 (comment)

@DevCubeHD
Copy link

DevCubeHD commented Oct 25, 2018

@rekmarks yeah, just think about when using git... nobody would ever include the node_modues folder

@coreyfarrell
Copy link
Collaborator

This issue should be resolved by latest graceful-fs. Please let us know if you continue to have problems after updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests