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

Unable to deploy with node.js #1420

Closed
quantum0hound opened this issue Feb 24, 2022 · 4 comments
Closed

Unable to deploy with node.js #1420

quantum0hound opened this issue Feb 24, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@quantum0hound
Copy link

quantum0hound commented Feb 24, 2022

Hello, I've implemented simple node app (https://github.com/quantum0hound/aetest):

index.js:

#!/usr/bin/env node
const {Crypto} = require ('@aeternity/aepp-sdk');

const keypair = Crypto.generateKeyPair();
console.log(`Secret key: ${keypair.secretKey}`);
console.log(`Public key: ${keypair.publicKey}`);    

package.json:

{
  "name": "aetest",
  "version": "1.0.0",
  "main": "index.js",
  "type": "commonjs",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "description": "",
  "dependencies": {
    "@aeternity/aepp-sdk": "^10.0.0"
  }
}

Execution raises SyntaxError: Unexpected token '?'


Logs:
/home/johndoe/work/aetest/node_modules/@aeternity/aepp-sdk/dist/aepp-sdk.js:1
!function(e,t){"object"==typeof exports&&"object"==typeof module? .......**(sources of aepp-sdk.js)** .port.onMessage.hasListener(this.handler)}}},oi),di=cn})(),C})()}));
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

SyntaxError: Unexpected token '?'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/johndoe/work/aetest/index.js:2:18)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

Process finished with exit code 1


@quantum0hound quantum0hound added the bug Something isn't working label Feb 24, 2022
@marc0olo
Copy link
Contributor

can somebody check this? is this bug already known? @davidyuk @subhod-i

@subhod-i
Copy link
Collaborator

subhod-i commented Mar 1, 2022

@quantum0hound using NodeJS v14 and above will resolve this issue.
@marc0olo we shall either fix this error to work on NodeJS v12 or update the https://github.com/aeternity/aepp-sdk-js/blob/develop/docs/compatibility.md document to v14.

@quantum0hound
Copy link
Author

Using github:aeternity/aepp-sdk-js#develop also solves the issue

@davidyuk
Copy link
Member

davidyuk commented Mar 1, 2022

this is the same issue as #1364, will be fixed in the near release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants