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

Node.js require #438

Closed
Sparkwired opened this issue Nov 30, 2018 · 2 comments
Closed

Node.js require #438

Sparkwired opened this issue Nov 30, 2018 · 2 comments
Labels

Comments

@Sparkwired
Copy link

I have a very simple node script to call, which requires ripple-lib. Before trying to execute the script, I'm setting up a NodeJS instance like this:

final NodeJS nodeJS = NodeJS.createNodeJS();
final V8Object jimp = nodeJS.require(new File("/Users/tomvdh/node_modules/ripple-lib"));

Unfortunately, this results in the following stacktrace:

/Users/tomvdh/node_modules/ripple-lib/dist/npm/api.js:72: SyntaxError: Unexpected token =
constructor(options = {}) {
^
SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object. (/Users/tomvdh/node_modules/ripple-lib/dist/npm/index.js:3:13)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
com.eclipsesource.v8.V8ScriptExecutionException
at com.eclipsesource.v8.V8._executeFunction(Native Method)
at com.eclipsesource.v8.V8.executeFunction(V8.java:1000)
at com.eclipsesource.v8.V8Function.call(V8Function.java:80)
at com.eclipsesource.v8.NodeJS.require(NodeJS.java:143)
at TestJ2V8.testCreateOrderWithJ2V8(TestJ2V8.java:39)
...

When I call the node script that I want to run on the command line, it executes fine so node and ripple-lib are ok. I'm running this on a Mac, my local npm is on 6.4.1, using following Maven dep for J2V8:

com.eclipsesource.j2v8 j2v8_macosx_x86_64 4.6.0

Any idea how to resolve this issue?

@Sparkwired
Copy link
Author

Additional info: was at the latest node version, now downgraded to v6.15.0 but this results in the same error.

@irbull irbull added the nodejs label Jan 10, 2019
@irbull
Copy link
Member

irbull commented Jan 10, 2019

I'm reducing the scope of this project to only support V8 on Android. If someone wants to take over the NodeJS support in a downstream project, I'd be in support of that, but I can't maintain that as part of this project. See #441 for more information.

I'm closing this as out of scope.

@irbull irbull closed this as completed Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants