{"record":{"id":"dd37f7109a3a1c8b","repo":"denoland/deno","slug":"either-node-or-range-must-be-provided-when-rep","errorCode":null,"errorMessage":"Either `node` or `range` must be provided when reporting an error","messagePattern":"Either `node` or `range` must be provided when reporting an error","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/js/40_lint.js","lineNumber":386,"sourceCode":"    this.filename = fileName;\n    this.sourceCode = new SourceCode(ctx);\n  }\n\n  getFilename() {\n    return this.filename;\n  }\n\n  getSourceCode() {\n    return this.sourceCode;\n  }\n\n  /**\n   * @param {Deno.lint.ReportData} data\n   */\n  report(data) {\n    const range = data.node ? data.node.range : data.range ? data.range : null;\n    if (range == null) {\n      throw new Error(\n        \"Either `node` or `range` must be provided when reporting an error\",\n      );\n    }\n\n    const start = range[0];\n    const end = range[1];\n\n    if (start > end) {\n      throw new RangeError(\n        `Invalid range. Start value is bigger than end value: [${start}, ${end}]`,\n      );\n    }\n\n    /** @type {Deno.lint.Fix[]} */\n    const fixes = [];\n\n    if (typeof data.fix === \"function\") {\n      const fixer = new Fixer();","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/js/40_lint.js#L368-L404","documentation":"To support `jsr:` packages under the stock-tsc compatibility setup, deno downloads registry metadata JSON from npm.jsr.io (deliberately via raw `HttpClient::download` so it does not pollute user-visible download logs). The download step's failures are tolerated with a `continue`, but if bytes arrive that `serde_json::from_slice` cannot parse as JSON, this error fires — the endpoint returned 200 with a non-JSON body.","triggerScenarios":"Metadata fetch succeeds at the HTTP level but the body is not valid JSON: an intercepting corporate proxy or SSL-inspection appliance returning an HTML block page with 200, a corrupted/truncated response from the registry, or an outage page served instead of the metadata document.","commonSituations":"Corporate proxies and Zscaler-style interception; flaky CI networks corrupting large responses; npm.jsr.io incidents; caching layers serving stale/broken bodies.","solutions":["Retry — transient corruption usually resolves on a second run","Inspect what the URL actually returns: `curl -sL <metadata-url> | head` (look for HTML/proxy pages)","Disable/bypass HTTP interception for npm.jsr.io, or configure `--cert`/`DENO_CERT` for TLS-inspecting proxies","If the registry itself is serving broken metadata, wait it out or pin affected jsr: deps to an older version"],"exampleFix":"# before\n$ deno check main.ts\n# Failed to parse metadata for @luca/flag: expected value at line 1 column 1\n\n# after (proxy was returning an HTML block page)\n$ curl -s https://npm.jsr.io/@luca/flag | head  # -> <html>...\n# add npm.jsr.io to proxy bypass list, then:\n$ deno check main.ts  # ok","handlingStrategy":"retry","validationCode":"# Verify the registry serves real JSON from your environment before building\ncurl -fsSL https://npm.jsr.io/@luca/flag | jq -e 'has(\"versions\")' >/dev/null \\\n  || echo 'registry/proxy is mangling metadata'","typeGuard":null,"tryCatchPattern":"Wrap install/check in a retry loop (2-3 attempts with short backoff) keyed on /Failed to parse metadata/: a 200-with-garbage-body is usually transient proxy/CDU corruption. If all attempts fail, stop and investigate the network path (curl the metadata URL) rather than looping.","preventionTips":["Add npm.jsr.io (and deno's registries) to corporate proxy bypass lists","Configure DENO_CERT/--cert when behind TLS inspection","Cache lockfiles so CI re-runs hit fewer registry round trips"],"tags":["network","registry","json","jsr","proxy"],"backgroundTag":"registry-metadata-invalid","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}