New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DevTools failed to load SourceMap #32
Comments
Hi @jhess666. Thank you for reporting this issue. |
Nope. It's a pure Windows environment. |
Hi @jhess666. I have a Windows 7 in VM and I am unable to reproduce the issue. Could you set up an example repo which reproduces this issue? Thanks. |
In my tests I have found where the issue is being originated (at least for me): // File: "./lib/Utils.js"
// ...
exports.replaceInFileSync = (files, stringToReplace, newString) => {
const regexPattern = escapeRegex(stringToReplace);
const result = replaceInFile.sync({
files,
from: new RegExp(regexPattern, 'g'),
to: newString // <-- here, it should be escaped
});
return result;
};
// ... |
@jhess666 Could you please set up an example repo that reproduces this issue? Thanks. |
Closing this since I was unable to reproduce the issue. Feel free to comment here and we'll reopen this if it happens again. |
Describe the bug
DevTools can't parse generated source maps.
How it happened?
The error is pretty much trivial and happens because of the path replacements (probably only for Windows).
It's easy to identify the reason just looking at the console log.
DevTools error message:
Unexpected token s in JSON at position 86
Now, let's take a look at the generated source map file.
The source map JSON:
See, the
sourceRoot
value contains a non-escaped string. Should be"..\\src"
;Desktop (please complete the following information):
Plugin configuration object:
The text was updated successfully, but these errors were encountered: