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

Doesn't work under [email protected] #73

Closed
lazdmx opened this issue Apr 23, 2017 · 2 comments
Closed

Doesn't work under [email protected] #73

lazdmx opened this issue Apr 23, 2017 · 2 comments
Assignees
Labels

Comments

@lazdmx
Copy link

lazdmx commented Apr 23, 2017

Latest release use some features that unsupported by [email protected] - ES6 default parameters for instance. So there is an error in attempt to run cli.js

.../.nvm/versions/node/v4.7.2/lib/node_modules/json-schema-to-typescript/dist/src/index.js:30
function compileFromFile(filename, options = exports.DEFAULT_OPTIONS) {
                                           ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)

@bcherny
Copy link
Owner

bcherny commented Apr 24, 2017

Thanks for the bug report. There are a few issues:

  1. Program is compiled to ES6, should be ES5
  2. Extending bultins (which we do for Error) does not work as expected when compiling to ES5
  3. Array#includes is undefined in Node < 6
  4. Ava only works on Node >= 4.5 (ava errors on Node <4.5.0 due to hullabaloo-config-manager avajs/ava#1354)
  5. Object key iteration algorithm changed somewhere between Node 4 and 6, producing different output in some cases. Specifically, the realWorld.swagger test case fails
  6. Manually reproducing the error in (5) triggers a circular dereferencing bug in json-schema-ref-parser (dereference() fails to deference circular ref APIDevTools/json-schema-ref-parser#37)

1-3 are quick fixes. I am looking into the rest, and will keep this issue updated with progress. For now, I would recommend using Node 6 if you can (especially since Node 4 has officially entered maintenance mode).

@bcherny bcherny self-assigned this Apr 24, 2017
@bcherny bcherny added the bug label Apr 24, 2017
@bcherny
Copy link
Owner

bcherny commented Apr 24, 2017

Published as 4.1.2. Tracking remaining issue in #77.

@bcherny bcherny closed this as completed Apr 24, 2017
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