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: Unexpected token ILLEGAL with java node_module #14

Open
totty90 opened this issue Feb 18, 2015 · 1 comment
Open

SyntaxError: Unexpected token ILLEGAL with java node_module #14

totty90 opened this issue Feb 18, 2015 · 1 comment

Comments

@totty90
Copy link

totty90 commented Feb 18, 2015

I'm using the webdriver-sync webdriver module which uses the java module. With the default node.js require everything works as expected. With the enhanced require the result is this:

C:\app\node_modules\webdriver-sync\node_modules\java\build\Release\nodejavabridge_bindings.node:1
nction (exports, require, define, module, __filename, __dirname) {MZ�
                                                                    ^
SyntaxError: Unexpected token ILLEGAL
  at NormalModuleMixin.Module._compile (C:\app\node_modules\enhanced-require\lib\Module.js:52:24)
  at RequireContext.theRequire (C:\app\node_modules\enhanced-require\lib\RequireContext.js:169:10)
  at C:\app\node_modules\webdriver-sync\node_modules\java\lib\nodeJavaBridge.js:7:16
  at NormalModuleMixin.Module._compile (C:\app\node_modules\enhanced-require\lib\Module.js:53:18)
  at RequireContext.theRequire (C:\app\node_modules\enhanced-require\lib\RequireContext.js:169:10)
  at C:\app\node_modules\webdriver-sync\node_modules\java\index.js:2:18
  at NormalModuleMixin.Module._compile (C:\app\node_modules\enhanced-require\lib\Module.js:53:18)
  at RequireContext.theRequire (C:\app\node_modules\enhanced-require\lib\RequireContext.js:169:10)
  at C:\app\node_modules\webdriver-sync\src\webdriver-sync.js:3:12
  at NormalModuleMixin.Module._compile (C:\app\node_modules\enhanced-require\lib\Module.js:53:18)
  at RequireContext.theRequire (C:\app\node_modules\enhanced-require\lib\RequireContext.js:169:10)
  at Object.<anonymous> (C:\app\tests\integration\support\World.js:15:10)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.module.exports (C:\app\tests\integration\steps\init.steps.js:2:18)
  at Array.forEach (native)
  at Object.<anonymous> (C:\app\tests\test.js:4:5)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:906:3

I notice the MZ� and happens because is a binary.

@totty90
Copy link
Author

totty90 commented Feb 18, 2015

Quick fix: I've added the originalRequire to the enhancedRequire and loaded the webdriver-sync with the original node.js require.

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

1 participant