Whether your domain uses a private or public source map, Noibu may struggle to consume the map if it lacks specific data. The best case scenario, if this happens, is that Noibu will reject the source map and revert the stackframes to minified code. In the worse case scenario, the faulty source map may cause a parsing error that prevents stackframes from loading.
In order for Noibu to successfully consume a source map, the map must contain the following fields:
version
file
mappings
sources
sourcesContent
names
Consider the dummy source map below as an example:
{ "version": 3, "file": "main.js", "mappings": ";AAAA,BBBB", "sources": [ "path/test.js", "path/test2.js" ], "sourcesContent": [ "var a = \\\\\\\"Hello\\\\\\\";\\\\n console.log(a)", "var b = \\\\\\\"World\\\\\\\";\\\\n console.log(b)" ], "names": ["someVariable", "ignite", "rocket"], "sourceRoot": "" }
Most source maps are generated with the version
, file
, mappings
, and sources
fields by default. Sometimes, however, the sourcesContent
field is omitted. This field, while optional in a standard source map, lists the original source content for each file in the "sources" property. Without this field defined, Noibu can't pinpoint the line/column number of an error in the original source code. This may cause consumption issues.
Learn more about Uploading a Private Source Map.