ITADN

[graphiql] Syntax highlighting and auto completion is broken

#4303Openglenngijsberts 创建于 2026-05-19
buggraphiql
G
glenngijsbertscommented
### Is there an existing issue for this? - [x] I have searched the existing issues ### Current Behavior The syntax highlighting and auto completion is not working. ### Expected Behavior Should work like previous versions (`@graphiql/react@0.37.3` and `@graphiql/plugin-explorer@5.1.1`). ### Steps To Reproduce 1. Use `@graphiql/react@0.37.4` and `@graphiql/plugin-explorer@5.1.2` 2. Open GraphiQL 3. Verify syntax highlighting and completion is not working ### Environment * GraphiQL Version: latest * OS: MacOS * Browser: Chrome * Bundler: esm * `react` Version: 19.1.0 * `graphql` Version: 16.11.0 ``` <script type="importmap"> { "imports": { "react": "https://esm.sh/react@19.1.0", "react/": "https://esm.sh/react@19.1.0/", "react-dom": "https://esm.sh/react-dom@19.1.0", "react-dom/": "https://esm.sh/react-dom@19.1.0/", "react-icons/": "https://esm.sh/react-icons@5.5.0/", "react-world-flags": "https://esm.sh/react-world-flags@1.6.0/", "graphiql": "https://esm.sh/graphiql?standalone&external=react,react-dom,@graphiql/react,graphql", "graphiql/": "https://esm.sh/graphiql/", "@graphiql/plugin-explorer": "https://esm.sh/@graphiql/plugin-explorer@5.1.1?standalone&external=react,@graphiql/react,graphql", "@graphiql/react": "https://esm.sh/@graphiql/react@0.37.3?standalone&external=react,react-dom,graphql,@graphiql/toolkit,@emotion/is-prop-valid", "@graphiql/toolkit": "https://esm.sh/@graphiql/toolkit?standalone&external=graphql", "graphql": "https://esm.sh/graphql@16.11.0", "@emotion/is-prop-valid": "data:text/javascript," } } </script> ``` ### Anything else? This error originates from Monaco Editor (which GraphiQL uses internally). It happens when code tries to call monaco.languages.setTokensProvider('json', ...) or monaco.languages.registerHoverProvider('json', ...) before Monaco has registered the json language — i.e., before the Monaco JSON language worker is initialized.
6 条评论