{"record":{"id":"913e1aa459e5ef4b","repo":"oracle/graal","slug":"polyglot-is-not-available-use-espresso-to-interac","errorCode":null,"errorMessage":"Polyglot is not available. Use Espresso to interact with other Truffle languages.","messagePattern":"Polyglot is not available\\. Use Espresso to interact with other Truffle languages\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/Polyglot.java","lineNumber":193,"sourceCode":"     * <p>\n     * To access members of the foreign object, write a corresponding class or interface stub in\n     * Java and cast the eval result to it using {@link #cast Polyglot.cast}.\n     *\n     * @param languageId the id of one of the Truffle languages\n     * @param sourceCode the source code in the language, identified by {@code languageId}\n     *\n     * @return the result of the evaluation as {@link Object}.\n     *\n     * @throws IllegalArgumentException\n     *             <ul>\n     *             <li>if the language is not available\n     *             <li>if parsing of the code fails\n     *             </ul>\n     * @since 21.0\n     */\n    @SuppressWarnings(\"unused\")\n    public static Object eval(String languageId, String sourceCode) {\n        throw new UnsupportedOperationException(\"Polyglot is not available. Use Espresso to interact with other Truffle languages.\");\n    }\n\n    /**\n     * {@link Polyglot#eval Evaluates} the given code in the given language, and\n     * {@link Polyglot#cast casts} the result to the given class.\n     * <p>\n     * See {@link Polyglot#cast} for the details of casting.\n     *\n     * @param languageId id of one of the Truffle languages\n     * @since 21.0\n     */\n    public static <T> T eval(String languageId, String sourceCode, Class<? extends T> targetClass) throws ClassCastException {\n        return cast(targetClass, eval(languageId, sourceCode));\n    }\n\n    /**\n     * Imports {@code name} from global Polyglot scope. If {@code name} does not exist in the scope,\n     * returns {@code null}.","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/Polyglot.java#L175-L211","documentation":"Error \"Polyglot is not available. Use Espresso to interact with other Truffle languages.\" thrown in oracle/graal.","triggerScenarios":"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.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Polyglot is not available. Use Espresso to interact with other Truffle languages.","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."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Polyglot is not available. Use Espresso to interact with other Truffle languages.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}