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

SyntaxError #250

Open
vitya3 opened this issue Sep 13, 2018 · 6 comments
Open

SyntaxError #250

vitya3 opened this issue Sep 13, 2018 · 6 comments

Comments

@vitya3
Copy link

vitya3 commented Sep 13, 2018

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
Copy link
Contributor

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

@vitya3
Copy link
Author

vitya3 commented Sep 14, 2018

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

@ttmc
Copy link
Contributor

ttmc commented Sep 14, 2018

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
Copy link
Author

vitya3 commented Sep 14, 2018

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
Copy link
Contributor

ttmc commented Sep 14, 2018

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

@ttmc ttmc reopened this Sep 14, 2018
@vitya3
Copy link
Author

vitya3 commented Sep 14, 2018

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

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