retrace icon indicating copy to clipboard operation
retrace copied to clipboard

fetchSourceMap tries to fetch <anonymous> URLs

Open ivkos opened this issue 5 years ago • 2 comments

retrace fails for the stack trace below with a 400 Bad Request error. I suspect it treats the <anonymous> literals as URLs and tries to send an HTTP request to %3Canonymous%3E.

ReferenceError: bork is not defined
    at UserForm._callee4$ (http://localhost:8080/static/js/13.25e3de7b.chunk.js:1482:17)
    at tryCatch (http://localhost:8080/static/js/main.f3e03149.chunk.js:12350:40)
    at Generator.invoke [as _invoke] (http://localhost:8080/static/js/main.f3e03149.chunk.js:12576:22)
    at Generator.prototype.<computed> [as next] (http://localhost:8080/static/js/main.f3e03149.chunk.js:12402:21)
    at asyncGeneratorStep (http://localhost:8080/static/js/13.25e3de7b.chunk.js:1157:103)
    at _next (http://localhost:8080/static/js/13.25e3de7b.chunk.js:1159:194)
    at http://localhost:8080/static/js/13.25e3de7b.chunk.js:1159:364
    at new Promise (<anonymous>)
    at UserForm.<anonymous> (http://localhost:8080/static/js/13.25e3de7b.chunk.js:1159:97)
    at UserForm.onFileSelect (http://localhost:8080/static/js/13.25e3de7b.chunk.js:1562:30)

The fetchSourceMap function might need additional checks to avoid such URLs: https://github.com/fgnass/retrace/blob/master/index.js#L60

ivkos avatar Jun 07 '19 15:06 ivkos

@ivkos we're seeing the same thing - did you ever sort out a workaround?

darrylkuhn avatar Jan 28 '20 22:01 darrylkuhn

I have the same problem. Workaround for now is a simple regex preprocessor for the stack:

stack = stack.replace(/\n.*\(<anonymous>\)/, '')

dasboe avatar May 06 '22 15:05 dasboe