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

Buffer.write(string, encoding, offset[, length]) is no longer supported (Node.js 6.x) #16

Open
integritybit opened this issue Sep 15, 2016 · 4 comments

Comments

@integritybit
Copy link

Hello,

Awesome library. Thank you . We are building a proof of concept using your wcf.js and Node 6.x. Getting an error in buffer.js with message "no longer supported"

Here's the error:
`
node app.js
Hello world
buffer.js:735
throw new Error('Buffer.write(string, encoding, offset[, length]) ' +
^

Error: Buffer.write(string, encoding, offset[, length]) is no longer supported
at Buffer.write (buffer.js:735:11)
at MultipartParser.initWithBoundary (C:\Users\Steve\Desktop\NodejsConsoleApp2\NodejsConsoleApp2\node_modules\formidable\lib\multipart_parser.js:61:17)
at Object.MimeReader.parse_multipart (C:\Users\Steve\Desktop\NodejsConsoleApp2\NodejsConsoleApp2\node_modules\ws.js\lib\handlers\client\mtom\mime-reader.js:16:12)
at Object.exports.parse_multipart (C:\Users\Steve\Desktop\NodejsConsoleApp2\NodejsConsoleApp2\node_modules\ws.js\lib\handlers\client\mtom\mime-reader.js:58:21)
at MtomClientHandler.receive (C:\Users\Steve\Desktop\NodejsConsoleApp2\NodejsConsoleApp2\node_modules\ws.js\lib\handlers\client\mtom\mtom.js:69:22)
at C:\Users\Steve\Desktop\NodejsConsoleApp2\NodejsConsoleApp2\node_modules\ws.js\lib\handlers\client\mtom\mtom.js:49:10
at Request._callback (C:\Users\Steve\Desktop\NodejsConsoleApp2\NodejsConsoleApp2\node_modules\ws.js\lib\handlers\client\http.js:27:7)
at Request.self.callback (C:\Users\Steve\Desktop\NodejsConsoleApp2\NodejsConsoleApp2\node_modules\request\request.js:187:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
`

Any ideas?

Thank you.

@chrisgh1
Copy link

chrisgh1 commented Jun 2, 2017

@integritybit I just ran into this error also wondering if you ever found a solution?

@chrisgh1
Copy link

chrisgh1 commented Jun 2, 2017

Found the solution. it is a problem in the node module formidable in the file multipart_parser.js on lines 61 and 62. You need to change them to this
this.boundary.write('\r\n--', 0, 'ascii'); this.boundary.write(str, 4, 'ascii');

just switch the 2nd and 3rd arguments.

@chrisgh1
Copy link

chrisgh1 commented Jun 6, 2017

After further investigation it looks like the bug in formidable was fixed in recent versions. I installed formidable version 1.1.1 and removed formidable version 1.0.9 and everything seems to work. I noticed in the package.json that the dev specifically calls for formidable version 1.0.9 ie( "dependencies": {
"bufferjs": ">= 1.0.2",
"dateformat": ">=1.0.2-1.2.3",
"formidable": "=1.0.9")

I don't know if there is any ramifications of using a more updated version of formidable but maybe the dev can chime in.

chrisgh1 added a commit to chrisgh1/ws.js that referenced this issue Jun 6, 2017
See following issue for discussion on error:
Buffer.write(string, encoding, offset[, length]) is no longer supported
yaronn/wcf.js#16
@i5o
Copy link

i5o commented Aug 14, 2020

Thank you @chrisgh1 sorry this is an old comment I know, but it just worked for me.

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

3 participants