js-bigchaindb-driver icon indicating copy to clipboard operation
js-bigchaindb-driver copied to clipboard

SyntaxError

Open vitya3 opened this issue 6 years ago • 6 comments

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

vitya3 avatar Sep 13 '18 01:09 vitya3

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

future-is-present avatar Sep 13 '18 07:09 future-is-present

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

vitya3 avatar Sep 14 '18 00:09 vitya3

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];

ttmc avatar Sep 14 '18 07:09 ttmc

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)

vitya3 avatar Sep 14 '18 14:09 vitya3

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

ttmc avatar Sep 14 '18 15:09 ttmc

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

vitya3 avatar Sep 14 '18 15:09 vitya3