ampproject / error-tracker

AMP Project's error logging server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect deobfuscated stack traces

dreamofabear opened this issue · comments

Might be a bug in Closure Compiler's source maps.

/cc @jridgewell

i believe this is a bug in closure compilers sourcemap (think justin mentioned it a while ago)

ill take the issue as part of upgrading closure

Yup, the issue here is CC is producing bad sourcemaps that don't correctly map back to the original code.

Couldn't find anything obvious in their issues queue or in g/js-compiler-users. It'd be great if we can follow up with their team with a repro case.

Manually deobfuscating traces will be terrible when public property renaming is enabled with 1-pass.

Malte suggests that this is caused by our post-compile transforms e.g. prepending AMP_CONFIG, replacing the RTV string (AMP_CONFIG change might be fixable by adding \n afterwards). Kris suggested using https://github.com/Rich-Harris/magic-string.

Oh man, I hadn't even thought about the AMP_CONFIG being prepended.

I submitted one fix, but there are at least two more issues to address in ampproject/amphtml#17061

ampproject/amphtml#17061 is now fixed. Need to wait 3 weeks for the new cuts to include the corrected source maps.

We'll be able to deploy #55 once ampproject/amphtml#17062 hits production next week.

Looks like ampproject/amphtml#17061 was insufficient and this requires more investigation.