node-shared-cache icon indicating copy to clipboard operation
node-shared-cache copied to clipboard

Error: length of property name should not be greater than 256 [CentOS 7 x64 & Win 10 x64]

Open vsdigitall opened this issue 7 years ago • 2 comments

On both linux and windows 64-bit systems I received the following message when trying:

WIN10 x64:

const binding = require('node-shared-cache') undefined obj = new binding.Cache("test", 512 * 1024); Error: length of property name should not be greater than 256 at formatValue (util.js:423:37) at Object.inspect (util.js:324:10) at REPLServer.self.writer (repl.js:365:19) at finish (repl.js:486:38) at REPLServer.defaultEval (repl.js:279:5) at bound (domain.js:301:14) at REPLServer.runBound [as eval] (domain.js:314:12) at REPLServer.onLine (repl.js:442:10) at emitOne (events.js:121:20) at REPLServer.emit (events.js:211:7)

CentOS 7 x64:

const binding = require('node-shared-cache') obj = new binding.Cache("test", 512 * 1024); Error: length of property name should not be greater than 256 at formatValue (util.js:423:37) at Object.inspect (util.js:324:10) at REPLServer.self.writer (repl.js:365:19) at finish (repl.js:486:38) at REPLServer.defaultEval (repl.js:279:5) at bound (domain.js:301:14) at REPLServer.runBound [as eval] (domain.js:314:12) at REPLServer.onLine (repl.js:442:10) at emitOne (events.js:121:20) at REPLServer.emit (events.js:211:7)

Please let me know if it is a bug or I am doing something wrong?

vsdigitall avatar Feb 08 '18 04:02 vsdigitall

However if I just igoner errors and try to set 'obj' property to some value it succeeds:

> obj.foo = 1
1
> obj.foo
1

But obj.set property is undefined:

> obj.set
undefined
> binding.set
undefined

NodeJS version: v 8.9.3

vsdigitall avatar Feb 08 '18 04:02 vsdigitall

It's mentioned in the docs:

"key length should also not be greater than 256"

https://github.com/kyriosli/node-shared-cache#constructor

manueltimita avatar Feb 21 '19 23:02 manueltimita