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

support node v6 #24

Closed
eleith opened this issue May 22, 2018 · 2 comments · Fixed by #25
Closed

support node v6 #24

eleith opened this issue May 22, 2018 · 2 comments · Fixed by #25
Labels
resolved Resolved issues

Comments

@eleith
Copy link
Contributor

eleith commented May 22, 2018

nextjs currently supports node v6, but using next-optimized-images fails when imported with the following

./node_modules/next-optimized-images/index.js:93
          ),
          ^

SyntaxError: Unexpected token )

i believe this is because node v6 doesn't support trailing commas. there might be other issues, this is just the first error i hit. i'm exploring now if v6 is fully unsupported or if there are existing workarounds.

@eleith
Copy link
Contributor Author

eleith commented May 22, 2018

not all dangling commas are a problem, but they seem to be in function calls. in particular, this will trip up node v6

const a = Object.assign(
    {"a": 1},
    {"b": 2},
  );

but this will work

const a = Object.assign(
    {"a": 1},
    {"b": 2}
  );

@cyrilwanner
Copy link
Owner

Thanks again for reporting this issue and directly creating a PR to fix it :)
Your fix is now published on npm with version 1.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolved Resolved issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants