Fix Monaco editor JSON diagnostics API path#93
Merged
Owen-Morgan825 merged 1 commit intomainfrom Jan 16, 2026
Merged
Conversation
2e959a7 to
b6e27c5
Compare
|
Add optional chaining to monaco.json.jsonDefaults to handle lazy-loaded JSON language features.
b6e27c5 to
9b1c625
Compare
Contributor
|
Looks good but I can't test it right now (the preview build to GitHub Pages is broken and my Chromebook doesn't have enough storage left to download the repo). Will test later today. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a TypeScript build error when accessing Monaco editor's JSON language features.
Problem
The JSON language features in Monaco are loaded lazily, so
monaco.json.jsonDefaultsmay be undefined when the effect runs. This caused a TypeScript error:Fix
Add optional chaining:
monaco?.json?.jsonDefaults?.setDiagnosticsOptions({...})