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

Global Sentry functions not recognized after upgrade to latest #12734

Closed
3 tasks done
Amy-B-Tradition opened this issue Jul 2, 2024 · 5 comments
Closed
3 tasks done
Labels
Package: react Issues related to the Sentry React SDK Type: Bug

Comments

@Amy-B-Tradition
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

8.13.0

Framework Version

React 18.3.1

Link to Sentry event

No response

SDK Setup/Reproduction Example

yarn upgrade @sentry/react --latest

(also tried deleting the line from package.json and then doing yarn add)

image
Note the global functions are red and Webstorm does not at all believe they are there.

Steps to Reproduce

We're still building with Parcel 1, but I don't think that matters.

I also tried removing my node_modules folder and reinstalling everything from scratch. Also, removed node_modules and parcel .cache and dist folders before reinstalling and starting, same result.

Expected Result

Functions are present and can be used.

Actual Result

Functions are not present or usable
image

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jul 2, 2024
@github-actions github-actions bot added the Package: react Issues related to the Sentry React SDK label Jul 2, 2024
@Amy-B-Tradition
Copy link
Author

Amy-B-Tradition commented Jul 2, 2024

It looks like the actual issue is that these functions were removed. After downgrading, I was able to see that these functions are marked as deprecated. That doesn't help someone who doesn't see that (either because the deprecation doesn't propagate to their environment or they just don't look at their Sentry setup that often) before upgrading. After upgrading, there is zero help. A note in the docs would be nice, but it would also be nice to do some branding on your TS types to help people out a little better as they're looking at it.

Also note I did a search of all the change logs for "react" between 7.91.0 and latest to see what changed. If it was included, it was not in a way that helped me to know what was happening.

@AbhiPrasad
Copy link
Member

The Sentry JavaScript SDKs follow semvar. The difference is between the 7.x.x set of SDKs, and 8.x.x set of SDKs. This constitutes a major version bump, which means the SDK will change it's top level API (exported methods/exposed options).

The CHANGELOG contains an entry for 8.0.0 which describes the breaking changes (what was removed/changed in 7.x) for the SDK: https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#800

In addition we also have an upgrade guide in our docs: https://docs.sentry.io/platforms/javascript/guides/react/migration/v7-to-v8/

Which we also highlight in our main docs: https://docs.sentry.io/platforms/javascript/guides/react/

We have recently released v8 of the JavaScript SDKs. If you're using version 7.x, we recommend upgrading to the latest version. Check out the Migration docs to learn how to update your code to be compatible with v8.

Please follow the migration guide, it shows you what to change. If you have any other questions, please let us know!

@AbhiPrasad AbhiPrasad closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
@Amy-B-Tradition
Copy link
Author

My point is that when you get to the point of seeing the error, there is no help for you there, and when you go to the BrowserTracing page, it also doesn't highlight what went wrong. IIRC, the 8.0.0 rc change was not between our version and latest. You can't expect people to go trawling through all the pages of changelogs looking for what you changed.

So, yes, I was eventually able to figure out what was wrong and fix it, but you may very well lose users with the bad DX. Also, most libraries maintain backward compatibility for more than 6 months.

@AbhiPrasad
Copy link
Member

IIRC, the 8.0.0 rc change was not between our version and latest

I created #12735 to highlight the migration guide better in our CHANGELOG by placing it at the top of the file. Does this change seem better for you?

Also, most libraries maintain backward compatibility for more than 6 months.

We still support 7.x! And on the latest versions of 7.x we have added deprecation warnings for all deprecated APIs. Therefore you can stay on 7.x, refactor any Sentry code necessary, and then move to 8.x whenever you want. We will maintain support for 7.x till the end of the year.

@Amy-B-Tradition
Copy link
Author

I think just having this issue will help a lot of people who don't find the migration guide and other docs. I went looking first in the sections of the docs that had to do with the missing functions, so perhaps a pointer to the migration guide from the configuration section would be helpful.

I also found that your migration tool doesn't work with Node 16, and because we're still on Parcel 1 and all the related old tools, we can't upgrade that now. You might want to think about the fact that people are using Sentry because their projects aren't perfect. If I have to spend a lot of time dealing with issues with upgrading Sentry, then I'm not clearing the other technical debt I inherited.

Note the reason I am even touching Sentry right now is bc you guys refused to add error handling for unhandled promise rejection to your ErrorBoundary that people have to use to get Sentry error handling there, so I want to make sure I'm hooking into the latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: react Issues related to the Sentry React SDK Type: Bug
Projects
Archived in project
Development

No branches or pull requests

2 participants