Comments (11)
But Chrome tells me a different trace:
collectLogger.js:49 #videomail > TypeError: Cannot read property 'ended' of undefined
at DestroyableTransform.Writable.write (https://videomail.io/js/main-36bb504261.min.js:15125:45)
at Duplexify._write (https://videomail.io/js/main-36bb504261.min.js:9893:184)
at doWrite (https://videomail.io/js/main-36bb504261.min.js:15019:135)
at writeOrBuffer (https://videomail.io/js/main-36bb504261.min.js:15015:8)
at Duplexify.Writable.write (https://videomail.io/js/main-36bb504261.min.js:15126:7)
at writeStream (https://videomail.io/js/main-36bb504261.min.js:18666:195)
at draw (https://videomail.io/js/main-36bb504261.min.js:18802:27)
Weird
from duplexify.
Using latest websocket-stream package, where Duplexify.Writable.write() is triggered
from duplexify.
Debugged more in Chrome. Problem is that part of code. state
is undefined here.
Writable.prototype.write = function (chunk, encoding, cb) {
var state = this._writableState;
var ret = false;
if (typeof encoding === 'function') {
cb = encoding;
encoding = null;
}
if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
if (typeof cb !== 'function') cb = nop;
if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) {
state.pendingcb++;
ret = writeOrBuffer(this, state, chunk, encoding, cb);
}
return ret;
};
from duplexify.
Socket is not destroyed, not ended yet. Using node v6.20 here.
from duplexify.
There is another weird thing: if I run my code locally, this does not happen. Only on my remote server upon deployment. Maybe a firewall issue?
from duplexify.
any advice?? would be good because it's breaking my site. thanks
from duplexify.
Can you reproduce it? You can try with wireshark to get a capture of the latest packet sent that triggers it.
from duplexify.
honestly, i have no idea how to reproduce - only happens on my remote server, not on my local server. and what exactly should i capture on wireshark? you can see it yourself, it's the site www.videomail.io - just hit on the record button and then that error happens every time :(
any quick advice would be very much appreciated - thanks
from duplexify.
@mcollina I found out, that this only happens when code is minified. Does not happen when not minified. I am minifying the client side code with gulp uglify like this
.pipe(plugins.if(settings.server.minify.js, plugins.uglify({
mangle: false, // because of angularjs :(
// keep line breaks for easier locating of weird errors (temporary)
output: {
"beautify": true, // Add new lines
"indent_level": 0, // Don't add indentation
"indent_start": 0
}
})))
from duplexify.
@mcollina to reproduce I guess you try to uglify some code that uses Duplexify and then see how it goes
from duplexify.
I'm having the same issue when I use sails
and google-storage
. If I disable sails, Google Storage works perfectly.
GS uses createWriteStream
which is failing
from duplexify.
Related Issues (15)
- `Buffer()` without a `new` keyword is going to be hard-deprecated soon HOT 4
- Support `objectMode` for one side only HOT 2
- socket.io-stream question HOT 1
- Publish new version HOT 1
- BUG: 'Uint8Array 未定义' in IE9 HOT 2
- Drop dependency on readable-stream HOT 5
- Convert to TypeScript HOT 2
- Errors emitted by non-streams2 unhandled HOT 1
- race condition HOT 2
- Catch the status of a child process as a stream error HOT 1
- 'drain' event not forwarder HOT 1
- wtf HOT 1
- Unhandled 'error' event HOT 1
- Incompatible with ReadableStream from [email protected]
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 duplexify.