-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
e.getLastBreadcrumb is not a function. (In 'e.getLastBreadcrumb()', 'e.getLastBreadcrumb' is undefined) #6542
Comments
Routing to @getsentry/team-web-sdk-frontend for triage. ⏲️ |
Hi @m-nathani please check that you've upgraded all |
Yup they are latest @Lms24 "@sentry/react": "^7.26.0",
"@sentry/replay": "^7.26.0",
"@sentry/tracing": "^7.26.0", |
When you install Just as a heads-up: I'm transferring this issue to the SDK repo by the way |
Yo, checked its latest: "node_modules/@sentry/core": {
"version": "7.26.0",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.26.0.tgz",
"integrity": "sha512-ydi236ZoP/xpvLdf7B8seKjCcGc5Z+q9c14tHCFusplPZgLSXcYpiiLIDWmF7OAXO89sSbb1NaFt9YB0LkYdLQ==",
"dependencies": {
"@sentry/types": "7.26.0",
"@sentry/utils": "7.26.0",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=8"
}
}, |
Hmm, usually these problems occur because of version mismatches, when you upgrade e.g. Replay or Browser but for some reason not core or any of the other Sentry dependencies. Is there any chance that you have a browser extension or 3rd party script installed that uses Sentry? Or are you perhaps using multiple Sentry instances yourself (Micro frontend architecture, module federation, etc)? Also, would you mind sharing your Sentry init config? I'm curious if you're doing anything special when setting up Sentry and Replay |
Hey.. I am pretty sure the versions are matched after the upgrade.. Moreover, for the extension I am not sure as this is opened on the client browser... However there is not any 3rd party apps that's using sentry. Lastly, there was an issue for multiple instance which we have solved on our app today and is fixed. Here the configuration we are doing for sentry: export const initSentry = () =>
Sentry.init({
dsn: process.env.REACT_APP_SENTRY_DSN,
release: `widget@${version}`,
environment: `widget@${process.env.REACT_APP_ENVIRONMENT}`,
ignoreErrors: [
/ResizeObserver loop limit exceeded.*/,
/SecurityError: The operation is insecure.*/,
/SecurityError: Blocked a frame with origin.*/,
/Non-Error promise rejection captured.*/
],
integrations: [new Integrations.BrowserTracing(), new Replay()],
// We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: isProductionEnv() ? 0.2 : 1.0,
// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: isProductionEnv() ? 0.1 : 1.0,
// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0
}); |
@Lms24 also even after fixing the multiple instance issue we are facing this error. Here is the link for all the events for this error: https://sentry.io/organizations/umai/issues/3808072447/events/?project=5264087&referrer=slack P.S: these events don't show the url or device info etc for this error somehow too |
Hi @m-nathani you might want to give version 7.27.0 a try, which we just released. In this version you should be able to use the Replay integration directly from
Would you mind sharing what this issue was? Are you using Sentry in a micro-frontend setup? |
Sure will give the
We have a Whenever our function to open modal was called, sentry was initialized too... so we moved sentry initialization outside of open modal function so that its only initialize when our widget gets mounted. |
@Lms24 Hii, i have upgraded sentry to Hopefully the breadcrumb error will be removed... FYI below the config i have done as you mentioned above: import * as Sentry from '@sentry/react';
import { Integrations } from '@sentry/tracing';
import { isProductionEnv } from 'utils/session';
export const initSentry = () =>
Sentry.init({
dsn: process.env.REACT_APP_SENTRY_DSN,
release: `webrms@${process.env.REACT_APP_VERSION}`,
environment: `webrms@${process.env.REACT_APP_ENVIRONMENT}`,
ignoreErrors: [
/ResizeObserver loop limit exceeded.*/,
/SecurityError: The operation is insecure.*/,
/SecurityError: Blocked a frame with origin.*/,
/Can't find variable: PaymentAutofillConfig.*/,
],
integrations: [new Integrations.BrowserTracing(), new Sentry.Replay()],
// We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: isProductionEnv() ? 0.1 : 0.6,
// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: isProductionEnv() ? 0.1 : 1.0,
// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,
}); P.S: the docs does not seems to be updated though with the new release: https://docs.sentry.io/platforms/javascript/session-replay/ |
Still facing the same error after upgrading to https://sentry.io/organizations/umai/issues/3808072447/events/?project=5264087&referrer=slack |
I was getting the same error, but after upgrading from I also realized that I DID have a version mismatch in my lock file. Some of my Before
After
|
Hi @mikemclin thanks for reporting! This is exactly what I'm suspecting to be the problem in such cases. @m-nathani I know that by now I must sound like a broken record (sorry about that) but please take a look at your lock file and if need be also delete and reinstall your
Correct me if I'm wrong but to me this sounds like you have two instances of Sentry - one for the "base" site and one for the modal. In this case I'd recommend check if all instances (i.e. all As I said, to me the only plausible reason for such an error is that there's some Sentry dependency that's not aligned with the rest. |
I am glad you are responding, and thanks for it 😃 .
That's correct 💯 , however we don't control the in this case what would you recommend ? 🤔 P.S: I am assuming sentry should support older version of its code too ?, because not all web apps who are using sentry would be running on same version. 😕 |
This is a complicated topic unfortunately. We usually try to keep this in mind, however it's not always possible and also not always reasonable to do so. What we for sure don't introduce, is breaking changes for public API (unless we're releasing a major, thereby following semver). However, the change we made that causes this issue, isn't a breaking change in semver terms. A little more technical background here:
I think your use case is a little complicated to be honest. IIUC, you'd like to use Replay on a website that's not entirely yours. Let me check back with the Replay team if this is an intended use case and if they have ideas how to do this best. I think your core problem in this case is that Replay is accessing the wrong hub. Internally, Replay calls |
I understand.. however, i am hoping it does not break our client website too.
I would love to hear.. yeah it's complicated for us too... we have to manage so many unwanted errors.. which we tend to keep them in
Sentry.makeMain seems a bit like a shortcut solution.. however not sure how reliable.. but sounds like would replace the client side sentry to mine too 😆. hub and client manually this sounds really cool for my usecase... however two question here
const hub = new Hub(client); |
I was suspecting problems like these. Generally, our SDK doesn't work too well in multiple hubs per page scenarios. It's on our roadmap (#5878 > "Exceptions/Scope Data Quality", #5217) to improve and eventually fix this but I can't guarantee that this will happen soon.
It should work fine with
Yup, first you need to create a const client = new BrowserClient({
dsn: "https://[email protected]/0",
transport: makeFetchTransport,
stackParser: defaultStackParser,
integrations: defaultIntegrations,
});
const hub = new Hub(client); Note that you need to explicitly pass {
// ...
integrations: [...defaultIntegrations, new Integrations.BrowserTracing(), new Sentry.Replay()],
} Let me know how this works out for you |
Hi, same issue here. But in our case, we have only one instance of Sentry. I tried to upgrade to 7.27.0 (from 7.24.0) and to import directly from It seems to happen only on Safari on iOS (16.1 and 16.2) edit: and on macOs too |
Hi @chabou, again, this likely happens because you have multiple Sentry versions in your |
I double checked this before my previous message. I am pretty sure that we are using only one version. Here my search result for
And this is strange that only our few safari users are impacted (this is a B2B saas mainly used with chorme/firefox on Windows) Should I give a try to the Sentry.makeMain workaround? |
@chabou makeMain would only make sense in a multi-hub scenario. What kind of app are you building? Also something that's injected into a side like the OP? Or just a conventional web app? If this is limited to Safari users, my strong suspicion is that there's some Safari browser extension that also uses Sentry. In that case, |
We are building a conventional web app. I will try to ask to our impacted users if they have any safari extension. And I will try the |
Hi @Lms24 , I tried both the ways to check which one works:
Moreover, using this
However, unfortunately it did not worked to stop getting the breadcrumbs error after doing below: Sentry.init({
dsn: process.env.REACT_APP_SENTRY_DSN,
...
});
// Once sentry is initialized, call "makeMain" to avoid errors where we have more then one sentry versions, and due to which sentry breaks.
// "getCurrentHub" overrides global sentry to the most recent version using, be it our or already registered globally,
// Further info: https://github.com/getsentry/sentry-javascript/issues/6542
Sentry.makeMain(Sentry.getCurrentHub()); |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Hi @Lms24, can you suggest me what i am doing wrong ? . |
Hi @m-nathani, apologies for the late reply. I don't think you're doing anything wrong necessarily. Your use case is just something that our SDK doesn't support well and at the moment, we can't do a lot to fix this.
One thing I generally want to stress is that Replay does not support being used in parts of a website. So I can't provide you support for replay in your modal as because of how |
@Lms24, Thanks for all the support, and hope the PR works. I agree to the limitation of the Replay... i hope in future we provide this cool features:
|
Environment
SaaS (https://sentry.io/)
Version
7.26.0
Link
https://sentry.io/organizations/umai/issues/3807945297/?project=5264087&referrer=slack
DSN
No response
Steps to Reproduce
it came after enabling replay and upgrading sentry to 7.26.0
Expected Result
should not throw this error.
Actual Result
Throwing exception of breadcrums not found.
The text was updated successfully, but these errors were encountered: