Skip to content
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

Javascript error stack trace shows outdated source code inconsistent and unrelated with the error, probably previously cached #69779

Open
php4fan opened this issue Apr 26, 2024 · 7 comments

Comments

@php4fan
Copy link

php4fan commented Apr 26, 2024

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

  1. I have an html web page with some javascript, using Sentry. This is the full source html code:
<!DOCTYPE html>
<html>
        <head>
                <meta charset="UTF-8">
                <meta name="viewport" content="width=device-width, initial-scale=1">
                <title>Testing Sentry</title>
                <script
                  src="https://js-de.sentry-cdn.com/********.min.js"
                  crossorigin="anonymous"
                ></script>
        </head>
        <body>
                Hello
                <script>

                        function whatevers() {

                                aaaaaa();
                        }

                        whatevers();
                </script>
        </body>
</html>

This triggers an error on purpose in order to test Sentry.

  1. I visit it on my browser to trigger the error
  2. I go to see the error in Sentry (https://none-ibo.sentry.io/share/issue/dab1fec013074ee8866f84754a233bde/)

Expected Result

The stack trace should look more or less something like this (this is what I get in the browser):

Uncaught ReferenceError: aaaaaa is not defined
    at whatevers (<XXXX>:18:5)
    at <XXXX>:21:4

where <XXXX> is whatever you want to call the root of my html document.

You don't have to show me the source code for context. If you do, I very much appreciate it, but then it has to be the true, exact source code as it was when the error was triggered. Anything else is unacceptable and worse than nothing.

Actual Result

The stack trace that Sentry shows me looks like this this:

image

Let me highlight it:
image

The stack trace is correct, but the source code that is shown is NOT the actual source code. It is NOT the source code as it was when the error happened (it couldn't possibly be, you can see that the stack trace reference a function that is not there), and it is NOT the source code as it is right now.
The source code that is being shown is what the source code was several minutes before the error happened, when another different error was captured.

Product Area

Unknown

Link

No response

DSN

No response

Version

No response

@getsantry
Copy link
Contributor

getsantry bot commented Apr 26, 2024

Assigning to @getsentry/support for routing ⏲️

@getsantry
Copy link
Contributor

getsantry bot commented Apr 29, 2024

Routing to @getsentry/product-owners-issues for triage ⏲️

@roggenkemper
Copy link
Member

Thanks for writing in the ticket! One question just so we can get a better sense of what is happening, if you trigger the error again, does the new event in Sentry still show the outdated stacktrace or is it up to date now?

@php4fan
Copy link
Author

php4fan commented Apr 29, 2024

if you trigger the error again, does the new event in Sentry still show the outdated stacktrace or is it up to date now?

Now it's up to date.
I mean the new occurrence of the error shows the updated code, but the old occurrence linked above (which was triggered with the new code, same as it is now) still shows the older code.

@roggenkemper
Copy link
Member

thanks for confirming, you also mentioned that the code being shown was code you had , but you had edited it. do you remember how long it was after you edited the code when you triggered the error? if you can't remember, that's ok! we should be able to look into it given the info that we have

@php4fan
Copy link
Author

php4fan commented Apr 30, 2024

do you remember how long it was after you edited the code when you triggered the error?

In the order of a couple of seconds. Maybe even less than a second (the time it takes to move from the terminal window where I was remotely editing it on the server, to the browser window and hit refresh) or a few second at most (assuming I had to partially type the url back into the browser's address bar as opposed to just refreshing an already-open page).

@roggenkemper
Copy link
Member

thanks for the info - i've followed up with the team and we will continue to look into why this happened and try to fix it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants