Unexpected Token error on starting fresh instance of Katalon

Recently I’m facing this issue with Katalon 10.4.2, when ever I start a fresh instance of Katalon then it shows this kinda error where it says unexpected token at some line.

But in reality

  • There is no error on line where it says error is present.
  • On another line it show error but it is no error - if i insert even a space at some other line and save again the error disappears.

Does anyone else also face this kind of issue?

It’s not high priority but every time I start a fresh instance of Katalon I have to first go and fix this issue.

Just close the Katalon and delete
/bin
/Libs
/.metadata/.plugins

and then reopen the project
I guess this will fix the issue

But yes, if you are using any external jar files then you will need to input those jar file again in the lib folder manaully, like if you use jt400 and other.

Why This Happens

Katalon is built on Eclipse + Groovy.

Sometimes:

Groovy indexer fails

Internal AST cache corrupts

Eclipse markers don’t refresh correctly

That’s why:

Adding a space → forces AST recompile → error disappears.

It’s not your code.

Problem Analysis

You’re experiencing a false positive syntax error in Katalon Studio 10.4.2 where:

  • Errors are reported on incorrect line numbers
  • The actual code has no syntax issues
  • Errors disappear after trivial edits (adding a space, saving)

This is a classic IDE parser state synchronization issue rather than an actual code problem. The fact that the error vanishes after making minor changes is a strong indicator of caching or parser state management problems in the IDE.

Root Cause

While the official Katalon Studio 10.4.2 release notes don’t specifically mention this exact issue, the pattern you’re describing is consistent with:

  1. Groovy parser cache issues in the IDE
  2. Syntax highlighting cache problems
  3. File state synchronization issues between the editor and the parser

The release notes for version 10.4.3 (December 22, 2025) do mention several fixes related to execution and UI responsiveness, including fixes for “opening or switching custom keywords causes prolonged loading” and “renaming object or test case folders causes KS to hang,” which suggests parser-related improvements were made in subsequent versions.

Solutions

Solution 1: Clear IDE Cache (Recommended First Step)

Steps:

  1. Close Katalon Studio completely
  2. Navigate to your Katalon workspace directory
  3. Delete the .metadata folder (this contains IDE cache and state)
    • Windows: C:\Users\[YourUsername]\[WorkspaceName]\.metadata
    • Mac: /Users/[YourUsername]/[WorkspaceName]/.metadata
    • Linux: /home/[YourUsername]/[WorkspaceName]/.metadata
  4. Restart Katalon Studio
  5. Reopen your project

Why this works: This clears all cached parser state and forces the IDE to re-parse your files fresh.


Solution 2: Clean and Rebuild Project

Steps:

  1. In Katalon Studio, go to Project > Clean
  2. Select your project and click Clean
  3. Wait for the rebuild to complete
  4. Reopen the affected test case or script

Solution 3: Invalidate IDE Caches

Steps:

  1. Close Katalon Studio
  2. Navigate to your Katalon installation directory
  3. Delete the configuration folder (contains IDE configuration cache)
  4. Restart Katalon Studio

Solution 4: Update to Latest Version

Since you’re on 10.4.2, consider upgrading to 10.4.3 (released December 22, 2025), which includes multiple fixes for:

  • Issues where “opening or switching custom keywords causes prolonged loading”
  • Performance improvements in file handling and parsing
  • General stability enhancements

Key Considerations

Why This Happens:

  • The Groovy parser in Katalon Studio sometimes caches incorrect state
  • When you make a trivial change (like adding a space), it forces the parser to re-evaluate the entire file
  • This re-evaluation clears the cached error state

Best Practices to Prevent This:

  1. Regularly clean your project cache
  2. Save files frequently (but this shouldn’t be necessary for syntax validation)
  3. Keep Katalon Studio updated to the latest patch version
  4. Avoid having multiple instances of Katalon Studio open simultaneously

References