-
-
Notifications
You must be signed in to change notification settings - Fork 180
Unnecessary warning on "invalid source map" for JSON files #283
Comments
@stnwk Looks as bug, empty string interpreted as false, feel free to PR
need fix, PR welcome
This warning can't has error stack, because we don't have error stack. It is just warnings. What message you expected? |
We already work in webpack to better warnings/errors logging, it is not part of uglify plugin. Feel free to opoen issue/send PR in webpack to improve this mechanism. |
I still see this warning for JSON file, which generates following sourcemap
which is, according to this fix should be treated as an emptyRawSourceMap, and should be a valid one expect(utils.isSourceMap(emptyRawSourceMap)).toBe(true); But I still see |
@creage please create new issue |
The problem is that the fix has not been released/published yet /cc @sokra |
Fixes empty source map validation (patch is unreleased upstream) webpack-contrib/uglifyjs-webpack-plugin#283
I'm currently getting this warning anyone with the fix can reach out |
Hi everyone :)
When
import()
ing a json file, the generated source map is valid but "empty", which causes https://github.com/webpack-contrib/uglifyjs-webpack-plugin/pull/268/files#diff-8968c62593320351ced6a0ef776ef599R8 to fail and emit a warning.See #268
Example:
data.json
generates the following source map:
Unfortunately this causes
isSourceMap()
from https://github.com/webpack-contrib/uglifyjs-webpack-plugin/pull/268/files#diff-8968c62593320351ced6a0ef776ef599 to not recognize it as a valid source map. (mappings
check fails).Even when using
SourceMapDevToolPlugin()
https://webpack.js.org/plugins/source-map-dev-tool-plugin/ and explicitely excluding source maps for such files the warning will still be added. This should definitely not happen, I guess? Of course there is "no valid source map", because there is no source map at all.Ultimately it adds the following warning to the webpack compiler output:
Sidenote: There is a typo, it should be "contains".
Side-Sidenote: This "warning" comes without any "error stack" and is really, really hard to debug. Also searching on google / stackoverflow etc. is extremely hard because it's so generic and there is no way of knowing who warned me. Is it webpack? Babel? Typescript?
I only found the cause by change after intense searching and almost losing my mind. 🤪
Would love to see some improved message here too :)
Cheers and thank you,
Stefan
The text was updated successfully, but these errors were encountered: