Comments (11)
Same error here.
Aparrently, is problem of new-linejson
from webtorrent-hybrid.
It appears both occurrences have happened on Windows. Also, newline-json
gives that error if the data begins with \n
, so we just have to find where that newline is coming from.
from webtorrent-hybrid.
parse.js
commenting out lines 30 and 31 are a band-aid let me know if helps you
from webtorrent-hybrid.
I already try commenting out line. But don't still work here.
from webtorrent-hybrid.
That newline-json
stream is receiving the stdout output of the Electron child process. So I think we will just have to ensure we consume the first byte (\n
) of the stdout stream when using Windows (although it sucks that we have to).
from webtorrent-hybrid.
why is windows the problem?
from webtorrent-hybrid.
Can you guys test with electron-eval
on this branch: https://github.com/mappum/electron-eval/tree/newline-fix?
from webtorrent-hybrid.
Nothing here.
I made all changes.
https://github.com/mappum/electron-eval/compare/newline-fix
And still show error here.
from webtorrent-hybrid.
I try with this:
this.child.stdout.once('data', (data) => {
// this hack fixes issues where some environments (namely Windows)
// prepend a '\n' at the beginning of the stdout stream. This breaks
// the JSON parser, so if the stream starts with '\n' we skip it
while(true){
var dec = data.toString().charCodeAt(0) ;
if(dec != 13 && dec != 10) break;
data = data.slice(1, data.length)
}
this.stdout.write(data)
this.child.stdout.pipe(this.stdout)
})
This aparently work here. Optimize my code, please.
Basicaly you need a left trim function in data array ..
Sorry my english. Thank you
from webtorrent-hybrid.
This should be fixed as of [email protected]
. Can you guys reinstall and confirm that the issue is fixed?
from webtorrent-hybrid.
Just tested on Windows. This looks fixed to me. Thanks @mappum.
from webtorrent-hybrid.
Related Issues (20)
- No interoperability with instant.io HOT 1
- undefined symbol: napi_add_env_cleanup_hook HOT 1
- installation error HOT 3
- Error: Cannot read property 'catch' of null HOT 4
- Dependency Dashboard HOT 1
- installation fails HOT 1
- node-pre-gyp not found
- Unable to read event under a event. HOT 3
- cannot read property 'replace' of undefined
- Cannot import in expressjs HOT 5
- TypeScript support HOT 1
- Nodejs WebTorrent.WEBRTC_SUPPORT false, but expected true HOT 1
- Update for Fast Extensions? HOT 2
- WebRTC peer, not working the linux cli HOT 10
- `npm install webtorrent-hybrid -g` fails on Ubuntu 20LTS and Windows 10 HOT 9
- shouldn't this repository be invalid as webtorrent/webtorrent #143 was merged HOT 1
- Error: Cannot find module '../build/Release/wrtc.node' When using
- globalThis is not defined HOT 3
- Error about `node-gyp` or `node-pre-gyp` when install HOT 10
- `npm i -S webtorrent-hybrid` — error HOT 3
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 webtorrent-hybrid.