Comments (18)
git blame points to the change starting from 08471b2 if it helps
from node-graceful-fs.
And the reason your eval
is altering global state in node 0.11.13 is because in your eval
, the line https://github.com/joyent/node/blob/v0.11.13/lib/fs.js#L153 is run, which modifies the global binding.
from node-graceful-fs.
Hm, interesting.
I suppose we could just extend the fs module, but I'd want to test it pretty thoroughly before publishing.
from node-graceful-fs.
Would it be possible to just add a guard in that function in node-core so that it doesn't call multiple times?
from node-graceful-fs.
but I'd want to test it pretty thoroughly before publishing
yes. i don't think there's any hurry here :) in fact, the dirtiest solution is to do the following, lol:
var lib = process.binding('natives').fs.replace(/\bbinding\.FSInitialize\b/, '(function(){})')
var src = pre + lib + post
Would it be possible to just add a guard in that function in node-core so that it doesn't call multiple times?
i.m.o. the only reason it's even like that is because of some weird circular dependency crap. but yes, i would think it should only call once; i don't see any reason why you'd want to call it multiple times. i believe the only reason it is even in js-land is because v8 will optimize the ops into less code than writing the same thing using the c++ api (this is according to the talk about that commit).
from node-graceful-fs.
Can you please see if 34e473a fixes the issue?
In your node program, you can type npm install isaacs/node-graceful-fs#34e473a915b6d10379151ce3b8ce591549b35c8a
to pull in the change.
from node-graceful-fs.
Yes, it does fix it for my limited testing.
I'm going to ping the following people here who were actually encountering the issue (and so I assume make more use of graceful-fs), hopefully for some feedback on if the change has noticeable effects:
@sam-github @mikebarnhardt @bnoordhuis @cgole @raymondfeng
from node-graceful-fs.
Would it be possible to just add a guard in that function in node-core so that it doesn't call multiple times?
You probably noticed, but a guard fixes fs, but breaks graceful-fs by reversing the problem: it causes the stat object to be an instance of fs.Stats, but not to be an instance of gfs.Stats.
The change LGTM, but I've only minimized reproductions.
from node-graceful-fs.
LGTM.
from node-graceful-fs.
So, works for the apps we noticed it with at strongloop (@cgole @raymondfeng @bnoordhuis and me).
@mikebarnhard?
from node-graceful-fs.
Breaks etag
, send
, serve-static
, browser-sync
.
from node-graceful-fs.
seams like it is working with Node v0.11.14 without this issue.
from node-graceful-fs.
If you are talking about etag module working, it's because I added a workaround, though it is slow.
from node-graceful-fs.
@dougwilson you are right , in my case browse-sync -> serve-static -> send -> etag
from node-graceful-fs.
@elado Are you saying that this gfs change fixes pillarjs/send#63, or that it's still broken? (That is, are you +1ing this change, or -1ing it?)
from node-graceful-fs.
Published as 3.0.2, since it seems to be a strictly good change that does not affect API at all.
from node-graceful-fs.
@isaacs it was a +1. Thanks.
from node-graceful-fs.
Hi @isaacs , I just wanted to chime in and thank you for coming up with the patch and eventually releasing it. I hope that it doesn't cause any new issues due to some un-forseen issue that it creates. In the end, because of the was the fs
module has been changed in 0.11, it helps graceful-fs
fulfill the "no global monkey patch" promise :)
from node-graceful-fs.
Related Issues (20)
- Problem with webpack 4 : Object prototype may only be an Object or null: undefined HOT 8
- Incompatible with Electron v10.x.y+ when dealing with .asar HOT 2
- TypeError: Cannot read property 'uid' of undefined HOT 2
- ReferenceError thrown from clone.js HOT 1
- cb is not a function HOT 5
- Manipulate PDF with NUXT 3 for digital sign HOT 1
- graceful-fs doesn't use node module location from .yarnrc HOT 1
- "web3.storage": "^4.3.0" has issues with Angular 14.0.3 with files-from-path and graceful-fs dependencies
- NOT using gulp - primordials error HOT 1
- missing file 'fs.js'
- statSync read .sqlite3 unknow
- Version 4.2.11 will not pull from npmjs
- Generate SLSA Build L3 provenance HOT 3
- EMFILE error when attempting to read dir with 10,000 files (Windows 11) HOT 4
- Waad
- TypeError: Cannot define property Symbol(graceful-fs.queue), object is not extensible HOT 1
- Gracefulfs suddenly doesn't work anymore HOT 1
- Different speed of file rename to non-accessible destination on Windows
- createWriteStream from node-graceful-fs causes a memory leak
- Node app crashed with TypeError: Object.setPrototypeOf called on null or undefined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-graceful-fs.