Skip to content

SyntaxError: Missing parenthesis after argument list

Error message

                Missing parenthesis after argument list
              

Quick summary

You called a function but forgot to close the parentheses, so JavaScript cannot parse the call.

Why this happens

  • Forgot the closing ) when calling a function

  • Mismatched parentheses in a complex expression

  • Copied code that was incomplete

Minimal example

✗ Broken code
console.log("hello";
✓ Fixed code
console.log("hello");

The closing ) is missing after the argument. Adding it completes the call.

How to diagnose

  • Look at the line mentioned in the error for an unclosed parenthesis

  • Count opening and closing parentheses — they should match

  • Use an editor with bracket matching to find the unclosed pair

How to fix

  • Add the missing closing parenthesis

  • Balance all parentheses in the expression

  • Run the code through a formatter (Prettier) to spot structural issues

How to prevent

  • Use an editor with bracket matching and syntax highlighting

  • Run a linter to catch syntax errors as you type

Related Resources

Related Glossary

Related Lessons

← Back to language