Why "Syntax Error" has no stacktrace?

There are different kinds of errors in the browsers:

  • A real javascript error that happens during execution
  • An error that happens before javascript is even executing.

SyntaxError belongs to the second group and will not provide detail information such as line and column.

This error occurs when the javascript code is not valid. Please check if there is a typo in the javascript code or if it delivers an html page instead of javascript code.

1 Like

Thanks for these troubleshooting steps @kanako_sato