-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
item.copy is not a function #7
Comments
It seems a problem with my config, i'll investigate why. |
Ok i've been stuck on that and discovered that if i use stream-http i'm getting the data as a Uint8Array, but if i use simple-get i'm getting it as a string, and then fails. This code with simple-get fails:
But this code with stream-http is working well
I don't understand why this is happening. I've seen that simple-get uses the node.js http with browserify, so i'm thinking that probably my node.js version has something to do with that. I've tried with 0.12.7, 0.12.4 and 4.1 and none of them worked well. Any advice would be apprecieted, i've been on this error for days and i cannot move forward :S Thanks |
You wouldn't happen to be using the More info here: https://gist.github.com/defunctzombie/4339901 Also, what browser are you running your examples in? |
Hi feross, thanks for your answer. No, i'm not using those flags, I use browserify with gulp and i'm using this config: .pipe(browserify({ I've tried latest version of Chrome and Firefox. I'm now thinking on the paths: ['client/'] line, because i have a node.js backend and front end on the same project, and probably this is messing something up with browserify. The folder structure i'm using is the following: /client If i understand well, I'm unzipping response when i shouldn't? That's why i'm seeing a string instead of a Buffer? That would explain a lot! |
It was only a hunch. I still have no idea why this is happening. It would help if you could share a small snippet of code that causes this issue. Right now I can only guess what the problem is. |
Are you sure that you're using browserify 11? |
Finally figured it out! I was using gulp-browserify, which is deprecated, and probably using an older versions of browserify. |
Hi,
I'm using this module from webtorrent, and i get an error from this module when using webseeding (webconn of bittorrent-swarm uses this module). The error is in this piece of code:
Buffer.concat implementation uses item.copy() on every part of the list, except that if the length of chunks is 1, then it returns chunks[0]. In that case there's no error.
I think Buffer.concat expects array of Buffer or Buffer to be sent, but we're sending strings. I've got no error with the following code:
But anyway the webseed fails. I'm opening an issue in webtorrent too, will ref to this.
Any advice? Thanks!
The text was updated successfully, but these errors were encountered: