Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
meta-json-schema (schema URL)
✓ https://unpkg.com/meta-json-schema/schemas/meta-json-schema.json
✗ https://cdn.jsdelivr.net/npm/meta-json-schema/schemas/meta-json-schema.json
Use unpkg URL; jsdelivr may serve different content or have stale cache.
configureMonacoYaml
✓ import { configureMonacoYaml } from 'monaco-yaml';
✗ const configureMonacoYaml = require('monaco-yaml');
monaco-yaml is ESM-only; CommonJS require will fail.
Schema usage in VS Code settings.json
✓ "yaml.schemas": {"https://unpkg.com/meta-json-schema/schemas/meta-json-schema.json": "**/*.yaml"}
✗ "yaml.schemas": {"https://unpkg.com/meta-json-schema/schemas/meta-json-schema.json": ["*.yaml"]}
Value must be a string (glob pattern) or array of strings, but common mistake is using an array without proper syntax.
Shows how to enable Meta JSON Schema in VS Code and Monaco Editor for YAML validation.
// 1. In VS Code settings.json:
{
"yaml.schemas": {
"https://unpkg.com/meta-json-schema/schemas/meta-json-schema.json": "**/*.yaml"
}
}
// 2. Or add a modeline at the top of your YAML file:
# yaml-language-server: $schema=https://unpkg.com/meta-json-schema/schemas/meta-json-schema.json
mode: rule
// 3. For Monaco Editor:
import * as monaco from 'monaco-editor';
import { configureMonacoYaml } from 'monaco-yaml';
configureMonacoYaml(monaco, {
validate: true,
enableSchemaRequest: true,
schemas: [
{
uri: 'https://unpkg.com/meta-json-schema/schemas/meta-json-schema.json',
fileMatch: ['**/*.clash.yaml']
}
]
});
Errors
Common errors & fixes
Cannot find module 'monaco-yaml' or its corresponding type declarations.
monaco-yaml is not installed or not declared in tsconfig.json
fixnpm install monaco-yaml; add 'monaco-yaml' to 'types' in tsconfig.json or use 'declare module'.
Request failed with status code 404 for https://unpkg.com/meta-json-schema/schemas/meta-json-schema.json
Typo in schema URL or using a version that doesn't exist
fixDouble-check the URL; use exact version like https://unpkg.com/meta-json-schema@1.19.26/schemas/meta-json-schema.json
The document is not valid YAML. Reason: unknown tag '!<tag:yaml.org,2002:...'
YAML file contains custom tags not supported by the schema
fixRemove custom YAML tags or disable validation for those lines.
Property mode is not allowed. (yaml-schema: meta-json-schema.json)
Using a property that is not in the schema; schema version mismatch
fixEnsure the schema matches your Clash Meta version; pin schema version to your Clash Meta version.
Audit
Dependencies
monaco-editoroptionalRequired when using Monaco Editor integration via monaco-yaml.
monaco-yamloptionalYAML language support for Monaco Editor; needed to configure the schema.
vite-plugin-monaco-editoroptionalVite plugin to bundle Monaco workers; simplifies setup for Vite projects.