oracle/graal · error · UnsupportedOperationException
Polyglot is not available. Use Espresso to interact with oth
Error message
Polyglot is not available. Use Espresso to interact with other Truffle languages.
What it means
Error "Polyglot is not available. Use Espresso to interact with other Truffle languages." thrown in oracle/graal.
Source
Thrown at espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/Polyglot.java:193
* <p>
* To access members of the foreign object, write a corresponding class or interface stub in
* Java and cast the eval result to it using {@link #cast Polyglot.cast}.
*
* @param languageId the id of one of the Truffle languages
* @param sourceCode the source code in the language, identified by {@code languageId}
*
* @return the result of the evaluation as {@link Object}.
*
* @throws IllegalArgumentException
* <ul>
* <li>if the language is not available
* <li>if parsing of the code fails
* </ul>
* @since 21.0
*/
@SuppressWarnings("unused")
public static Object eval(String languageId, String sourceCode) {
throw new UnsupportedOperationException("Polyglot is not available. Use Espresso to interact with other Truffle languages.");
}
/**
* {@link Polyglot#eval Evaluates} the given code in the given language, and
* {@link Polyglot#cast casts} the result to the given class.
* <p>
* See {@link Polyglot#cast} for the details of casting.
*
* @param languageId id of one of the Truffle languages
* @since 21.0
*/
public static <T> T eval(String languageId, String sourceCode, Class<? extends T> targetClass) throws ClassCastException {
return cast(targetClass, eval(languageId, sourceCode));
}
/**
* Imports {@code name} from global Polyglot scope. If {@code name} does not exist in the scope,
* returns {@code null}.View on GitHub (pinned to a66e9ccd1d)
Solutions
- Fix the condition reported by the error: Polyglot is not available. Use Espresso to interact with other Truffle languages.
- Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call.
Example fix
Validate inputs and environment so that the failing condition does not occur: Polyglot is not available. Use Espresso to interact with other Truffle languages.
When it happens
Trigger: Thrown at espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/Polyglot.java:193 when the library encounters an invalid state.
Common situations: Occurs when a caller violates the contract guarded by this check: Polyglot is not available. Use Espresso to interact with other Truffle languages.
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/913e1aa459e5ef4b.
Report an issue: GitHub.