Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More
Open

see no way send

Roshan Perera

Bugzilla Report Package

Product: Developer Tools

Component: General / Debugger

Title: [Source Map Loader] Worker crash due to unhandled JSON.parse error on non-JSON/HTML responses in fetchSourceMap.js

Description:

When fetching source maps in a worker context, fetchSourceMap.js occasionally encounters an unexpected non-JSON response (such as an HTML error page or 404 response starting with ). This causes an unhandled JSON.parse exception at line 83 (_fetch), crashing the source map consumer.

Stack Trace: Plaintext

Source map error: Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data Stack in the worker: parseSourceMapInput@resource://devtools/client/shared/vendor/source-map/lib/util.js:163:15 _factory@resource://devtools/client/shared/vendor/source-map/lib/source-map-consumer.js:1069:22 SourceMapConsumer@resource://devtools/client/shared/vendor/source-map/lib/source-map-consumer.js:26:12 _fetch@resource://devtools/client/shared/source-map-loader/utils/fetchSourceMap.js:83:19

Proposed Patch (fetchSourceMap.js - Line 83): JavaScript

// Replace direct unhandled parse at line 83 with safe parsing: const sourceMap = (() => {

 try {
   const trimmed = responseText ? responseText.trim() : "";
   if (trimmed.startsWith("<") || trimmed.startsWith("

})();

Bugzilla Report Package Product: Developer Tools Component: General / Debugger Title: [Source Map Loader] Worker crash due to unhandled JSON.parse error on non-JSON/HTML responses in fetchSourceMap.js Description: When fetching source maps in a worker context, fetchSourceMap.js occasionally encounters an unexpected non-JSON response (such as an HTML error page or 404 response starting with <!DOCTYPE html>). This causes an unhandled JSON.parse exception at line 83 (_fetch), crashing the source map consumer. Stack Trace: Plaintext Source map error: Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data Stack in the worker: parseSourceMapInput@resource://devtools/client/shared/vendor/source-map/lib/util.js:163:15 _factory@resource://devtools/client/shared/vendor/source-map/lib/source-map-consumer.js:1069:22 SourceMapConsumer@resource://devtools/client/shared/vendor/source-map/lib/source-map-consumer.js:26:12 _fetch@resource://devtools/client/shared/source-map-loader/utils/fetchSourceMap.js:83:19 Proposed Patch (fetchSourceMap.js - Line 83): JavaScript // Replace direct unhandled parse at line 83 with safe parsing: const sourceMap = (() => { try { const trimmed = responseText ? responseText.trim() : ""; if (trimmed.startsWith("<") || trimmed.startsWith("<!DOCTYPE")) { throw new Error("Received HTML instead of JSON"); } return JSON.parse(responseText); } catch (err) { console.warn(`SourceMapLoader: Failed to parse source map.`, err); return null; } })();

All Replies (1)

Hi

Why are you sending us a copy of that bug?

Tanya soalan

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.