Description
*This is a regression due to ALOY-1629, as babel became stricter on syntax being "more correct. There's nothing we can do to stop this being thrown, other than backing that out which imo we shouldnt do. We should prefer correctness*
When we hit an error in the parsing of code in the sourcemap step we currently log it a trace level and rethrow it. This doesn't really help a user figure out what's wrong, we should handle it similarly to other babel processing errors where we construct a codeframe for the error and log that to give a user some context as to what the error is
We should be able to achieve this by using the [dieWithCodeFrame](
https://github.com/appcelerator/alloy/blob/c63914c87610bcd1bc0e8be3426b160783a0991e/Alloy/utils.js#L535) function from utils, as the error is thrown by babel we should have the required info
Steps to reproduce
1. Add the below to a file under lib
function getStoredAnswers() {
}
function getStoredAnswers() {
}
2. Run a build for any platform
Actual
The build errors with a stacktrace, but no real useful info
Expected
The build should error with a codeframe to try and point a user to the right location and what the error is
PR: https://github.com/appcelerator/alloy/pull/935
FR Passed. Better error is shown with the fix: e.g
Closing. Studio Ver: 5.1.3.201907112159 SDK Ver: 8.1.1.v20190820115323 OS Ver: 10.14.5 Xcode Ver: Xcode 11.0 Appc NPM: 4.2.14 Appc CLI: 7.1.1-master.5 Daemon Ver: 1.1.3 Ti CLI Ver: 5.2.1 Alloy Ver: 1.14.1 Node Ver: 10.16.1 NPM Ver: 6.9.0 Java Ver: 10.0.2 Devices: ⇨ google Pixel (Android 9)