最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to prevent Firefox DevTools from showing "Source Map not found" errors? - Stack Overflow

programmeradmin3浏览0评论

I am using a couple of 3rd party minified Javascript files that have no .map file. When I am debugging in Firefox DevTools, it consistently shows these errors:

Source map error: request failed with status 404
Resource URL: .min.js
Source Map URL: widgets.min.js.map

This is really distracting since there are a number of these files and they really pollute the console.

Is there anyway to turn these warnings off?

I am using a couple of 3rd party minified Javascript files that have no .map file. When I am debugging in Firefox DevTools, it consistently shows these errors:

Source map error: request failed with status 404
Resource URL: https://foo.domain.com/widgets/widgets.min.js
Source Map URL: widgets.min.js.map

This is really distracting since there are a number of these files and they really pollute the console.

Is there anyway to turn these warnings off?

Share Improve this question asked Jun 18, 2018 at 19:02 AngryHackerAngryHacker 61.6k109 gold badges354 silver badges623 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 19

You can disable source maps globally by going into the Toolbox Options of the Developper Tools and unchecking Enable Source Maps.

You can also provide an empty source map for some specific JavaScript files. Use a local copy of the files (at least during development) and modify the source maps directive:

//# sourceMappingURL=http://example.com/path/to/your/sourcemap.map

by pointing to an empty source map file. You can also just remove the source map directive from the file.

发布评论

评论列表(0)

  1. 暂无评论