DELAPARRA
Index
Color
NL
Category: Error types

SyntaxError

Explained by Updated

What is SyntaxError?

SyntaxError: The code is not written according to the language rules — the parser cannot understand it at all. A SyntaxError means the code does not follow the rules of the language, so it cannot even be parsed. A missing bracket, an unclosed string or a misplaced comma are typical causes.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about SyntaxError

How is SyntaxError used in practice?

Because the parser stops at the first problem, nothing in the file runs. The error message gives a line number, but the real mistake is often a few lines earlier, such as a bracket opened and never closed.

What should you keep in mind with SyntaxError?

Editors show syntax errors as you type, and linters catch them before you commit, so they rarely reach production. When they do, it is often through a deployment that skipped a build step, or code that runs on an older language version than the one it was written for, for example newer PHP syntax deployed to a server running an older PHP. A CI step that runs the code on the production version prevents that.

At a glance

CategoryError types
Explained by
Updated

More Error types terms

All terms starting with S

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.