-
Notifications
You must be signed in to change notification settings - Fork 12
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
.slice is not a function #6
Comments
decodeMessage is expecting an array of bytes, which should have a slice function. If you're passing in a Uint8Array or Buffer it'll probably fail. |
I tried to run readTag example from this library as is. But it failed.
When I have modified this example and I passed data to decoding, it worked. But I think there is some problem with library and/or Node.JS version because in raw version of examples were errors. |
@greggyPL |
I have got problem similiar to issue#4. I have now newest version of Node.JS (v.8.2.1) and I am running everything on Linux.
When I was trying to run of examples (readTag.js) from this library (and also mifare-classic examples) I got error:
`WARNING: End of message does not look correct. Expecting 0xFE but got 110
<Buffer d1 01 08 54 02 65 6e 48 65 6c 6c 6f>
/home/pi/magisterka/ndef-js/lib/ndef.js:276
var bytes = bytes.slice(0), // clone since parsing is destructive
^
TypeError: bytes.slice is not a function
at Object.decodeMessage (/home/pi/magisterka/ndef-js/lib/ndef.js:276:27)
at printNdefInfo (/home/pi/magisterka/ndef-js/examples/readTag.js:16:20)
at ChildProcess. (/home/pi/magisterka/ndef-js/examples/readTag.js:53:9)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at maybeClose (internal/child_process.js:921:16)
at Socket.stream.socket.on (internal/child_process.js:348:11)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at Pipe._handle.close [as _onclose] (net.js:549:12)
`
I dont know what should I change to support this version of Node?
The text was updated successfully, but these errors were encountered: