Skip to content

A language with id regex is not installed. Did you mean regex? Installed languages are: regex #10908

@JaroslavTulach

Description

@JaroslavTulach

Describe GraalVM and your environment :

  • GraalVM version or commit id if built from source: GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30)
  • CE or EE: CE
  • JDK version: JDK21
  • OS and OS Version: Ubutnu
  • Architecture: amd64
  • The output of java -Xinternalversion:
OpenJDK 64-Bit Server VM (21.0.2+13-jvmci-23.1-b30) for linux-amd64 JRE (21.0.2+13-jvmci-23.1-b30), built on 2024-01-06T13:12:14Z by "buildslave" with gcc 11.2.0

Have you verified this issue still happens when using the latest snapshot?
You can find snapshot builds here: https://github.com/graalvm/graalvm-ce-dev-builds/releases

Describe the issue

This is a funny error message:

Caused by: java.lang.IllegalArgumentException: A language with id 'regex' is not installed. Did you mean 'regex'? Installed languages are: [internal/nfi-native, arrow, epb, enso, regex, js, nfi, python].
        at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineException.illegalArgument(PolyglotEngineException.java:129)
        at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineImpl.throwNotInstalled(PolyglotEngineImpl.java:1191)
        at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineImpl.requireLanguage(PolyglotEngineImpl.java:1180)
        at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.requirePublicLanguage(PolyglotContextImpl.java:1915)
        at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.lookupLanguageContext(PolyglotContextImpl.java:1877)
        at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.initializeLanguage(PolyglotContextImpl.java:1846)
        at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextDispatch.initializeLanguage(PolyglotContextDispatch.java:57)
        at org.graalvm.polyglot/org.graalvm.polyglot.Context.initialize(Context.java:617)
        at org.enso.language.server/org.enso.languageserver.boot.resource.TruffleContextInitialization.initComponent(TruffleContextInitialization.java:48)

Probably caused by regex being an internal language and calling context.initialize("regex") being forbidden.

Code snippet or code repository that reproduces the issue

Context.create().eval("regex", ".*");

Expected behavior

Mention that regex is internal language and it cannot be accessed via Context.eval

Additional context

https://graalvm.slack.com/archives/CNQSB2DHD/p1742625880472579?thread_ts=1742625833.674619&cid=CNQSB2DHD

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions