I have the following valid javascript with trailing comma in function parameters:

const a = (...params) => console.log(params);

But in js2-mode I see the error missing ) after argument list. Here is the screenshot of my emacs window - https://i.sstatic.net/GFuBM.png

There is issue about that and PR for js2-mode on github:

As you can see on the screenshot I have the latest js2-mode with code from this PR.

Why do I still get this error? How can I fix or debug it? Any help is appreciated

Edit 0: How to reproduce this in clean environment?

  1. start clean emacs in docker using docker run --rm -ti jare/emacs emacs -nw
  2. install js2-mode: M-x package-install RET js2-mode
  3. create empty buffer, enable M-x js2-mode, type same text as in example
  4. see the same error - https://i.sstatic.net/NYU6s.png
  • It works fine for me. Do you have flycheck enabled or any other linter?
    – caisah
    Sep 29, 2017 at 20:31
  • Yes it was enabled at that time. Disabled it and edited code - still got this error Sep 29, 2017 at 22:21
  • @caisah I've updated question with steps to reproduce this issue in a clean environment. Are you sure it works for you? Maybe you have js2-mode disabled at all? Sep 29, 2017 at 23:38

1 Answer 1


Appeared that this feature was not yet supported by js2-mode, but my PR #454 was merged and should be available soon.

If you want to use it right now - the latest version is available on github. If you are using spacemacs - add this lines to .spacemacs file:

  '((js2-mode :location (recipe :fetcher github :repo "mooz/js2-mode")))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.