bigchaindb / js-bigchaindb-driver

Official BigchainDB JavaScript driver for Node.js and the browser
https://docs.bigchaindb.com/projects/js-driver/en/latest/usage.html
Apache License 2.0
216 stars 92 forks source link

SyntaxError #250

Open vitya3 opened 6 years ago

vitya3 commented 6 years ago

Hi, any ideas how to fix it?

nodejs ./bigchaindb/helloworld.js /root/node_modules/query-string/index.js:148 let [key, value] = param.replace(/+/g, ' ').split('='); ^

SyntaxError: Unexpected token [ at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:374:25) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Module.require (module.js:354:17) at require (internal/module.js:12:17) at Object. (/root/node_modules/bigchaindb-driver/dist/node/stringify_as_query_param.js:21:20) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10)

Regards

future-is-present commented 6 years ago

Hi @vitya3 this is not an issue with the js-bigchaindb-driver.

vitya3 commented 6 years ago

Ok, so where should I go with my problem? I was redirected here from the bigchaindb

ttmc commented 6 years ago

Hi @vitya3, I think the split() method returns an array of strings, so this might give you what you want:

let pieces = param.replace(/+/g, ' ').split('=');
let key = pieces[0];
let value = pieces[1];
vitya3 commented 6 years ago

Hi @ttmc , thanks for suggestion. I tried it but got another error during the execution: nodejs ./bigchaindb/helloworld.js /root/node_modules/crypto-conditions/src/types/prefix-sha256.js:127 const subtypes = new Set([...this.subcondition.getSubtypes(), this.subcondition.getTypeName()]) ^^^

SyntaxError: Unexpected token ... at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:374:25) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Module.require (module.js:354:17) at require (internal/module.js:12:17) at Object. (/root/node_modules/crypto-conditions/index.js:7:22) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10)

ttmc commented 6 years ago

I don't have enough information to figure out what's going wrong.

vitya3 commented 6 years ago

@ttmc thank you so much anyway PS: What kind of information you may need?