Skip to content

Fix Monaco editor JSON diagnostics API path - #93

Merged
Owen-Morgan825 merged 1 commit into
mainfrom
fix-monaco-json-api
Jan 16, 2026
Merged

Fix Monaco editor JSON diagnostics API path#93
Owen-Morgan825 merged 1 commit into
mainfrom
fix-monaco-json-api

Conversation

@luanzeba

@luanzeba luanzeba commented Jan 16, 2026

Copy link
Copy Markdown
Collaborator

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.jsonDefaults may be undefined when the effect runs. This caused a TypeScript error:

error TS2339: Property 'jsonDefaults' does not exist on type '{ deprecated: true; }'.

Fix

Add optional chaining: monaco?.json?.jsonDefaults?.setDiagnosticsOptions({...})

@luanzeba
luanzeba force-pushed the fix-monaco-json-api branch 2 times, most recently from 2e959a7 to b6e27c5 Compare January 16, 2026 04:04
@github-actions

github-actions Bot commented Jan 16, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.0

🚀 View preview at
https://FRC2713.github.io/QRScout/pr-preview/pr-93/

Built to branch gh-pages at 2026-01-16 04:23 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Add optional chaining to monaco.json.jsonDefaults to handle
lazy-loaded JSON language features.
@luanzeba
luanzeba force-pushed the fix-monaco-json-api branch from b6e27c5 to 9b1c625 Compare January 16, 2026 04:23
@luanzeba
luanzeba marked this pull request as ready for review January 16, 2026 04:32
@Owen-Morgan825

Copy link
Copy Markdown
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.

@Owen-Morgan825
Owen-Morgan825 merged commit c312a7c into main Jan 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants