Runtime errors
ExtensionError — file must be a .ocat file
ExtensionError — file must be a .ocat file
Error messageCauseYou ran Or use the force flag to run the file without renaming it:
ocat run on a file that does not have the .ocat extension, and the -f flag was not passed.FixRename the file to use the .ocat extension:FileDoesn'tExistError — file not found
FileDoesn'tExistError — file not found
Error messageCauseThe file path passed to
ocat run does not exist on disk.FixVerify the path is correct and that you are running the command from the right directory:SyntaxError — undefined or unexpected token
SyntaxError — undefined or unexpected token
Error messagesCauseThe OCat parser encountered a token it did not recognise, or a token appeared in a position where it was not expected.FixCheck the line reported in the error. Common causes:
- A typo in a keyword (
pritinstead ofprint) - Missing quotes around a string literal
- An unsupported operator or symbol
Undeclared variable or function
Undeclared variable or function
Error messagesCauseYou are referencing a variable or function that has not been declared in the current scope.FixDeclare the variable before using it:For functions, ensure the
func definition appears before the call:Already declared variable or function
Already declared variable or function
Error messagesCauseA variable or function with that name was declared more than once in the same scope.FixRemove the duplicate declaration or rename one of them.
CantModifyConstError — constant variable modified
CantModifyConstError — constant variable modified
Error messageCauseThe
CantModifyConstError is defined in the source but the const enforcement logic is not yet active in the current runtime (1.3.x). The error class exists but is not triggered in practice. This will become relevant once const enforcement is enabled in a future release.Future fixOnce const enforcement is active, reassigning a const variable will raise this error. Declare the variable without const if you need to change its value.Project and CLI issues
ocm run fails — config.json not found
ocm run fails — config.json not found
Cause
ocm run reads the project entry point from .ocat/config.json. If that file is missing, the command cannot determine which file to run.FixMake sure you are running ocm run from the root of your OCat project — the directory that contains the .ocat/ folder:The
.ocat/config.json file is created automatically by ocm initialize. If you created the project manually, ensure the file exists and contains a main field pointing to your entry file.Import not resolving — module not found
Import not resolving — module not found
CauseThe module service resolves imports by trying the following paths in order:
- The exact path as written
- The path with
.ocatappended - The path with
.ocappended
null and no symbols are imported.FixEnsure the imported file exists with one of the supported extensions:Known historical bugs
Functions don't work (BUG-001A, fixed in 0.3.1)
Functions don't work (BUG-001A, fixed in 0.3.1)
Affected versions: 0.3.0Functions defined with
func failed to execute correctly in version 0.3.0.Fix: Upgrade to 0.3.1 or later.Variables and prints don't work (BUG-003A, fixed in 1.3.1)
Variables and prints don't work (BUG-003A, fixed in 1.3.1)
Affected versions: 1.3.0Variable declarations and
print() statements were broken after the runner restructure introduced in 1.3.0.Fix: Upgrade to 1.3.1 or later.CLI always uses force mode (BUG-002A, fixed in 1.0.1)
CLI always uses force mode (BUG-002A, fixed in 1.0.1)
Affected versions: 1.0.0The
-f flag was always active in 1.0.0, meaning the extension check was never enforced regardless of whether you passed -f.Fix: Upgrade to 1.0.1 or later.CLI errors show 'undefined' (BUG-002B, fixed in 1.1.1)
CLI errors show 'undefined' (BUG-002B, fixed in 1.1.1)
Affected versions: 1.0.0 – 1.1.0When an error was thrown, the CLI printed
undefined instead of the actual error message.Fix: Upgrade to 1.1.1 or later.Getting help
If your issue is not covered here, open an issue or browse existing reports on the GitHub repository:GitHub Issues
Report bugs, request features, or search existing issues
Changelog
Check whether your issue was fixed in a newer release