sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Permission denied to access property "apply" (Firefox)

Open lerela opened this issue 2 years ago • 9 comments

Is there an existing issue for this?

  • [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [X] I have reviewed the documentation https://docs.sentry.io/
  • [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/nextjs

SDK Version

7.26.0

Framework Version

Next 12

Link to Sentry event

https://sentry.io/organizations/fasfox/issues/3787755937/

Steps to Reproduce

For 10 days, we have seen new errors pop up that do not seem to match user code as the exception Permission denied to access property "apply" is located in ./node_modules/.pnpm/@[email protected]/node_modules/@sentry/utils/esm/instrument.js. We've upgraded to 7.26.0 but the errors continue to happen.

At this moment I do not know if this means something is crashing as we've not been able to reproduce it ourselves.

It seems to only happen with Firefox, which sounds like #3344 but that has been fixed a while ago.

We have not been able to link those errors to application changes but we might be wrong, however the trace does not allow us to find the culprit.

Expected Result

No exception coming from Sentry code itself

Actual Result

Exception seems to be coming from Sentry SDK

Screenshot 2022-12-15 at 09-56-17 Error Permission denied to access property apply

lerela avatar Dec 15 '22 09:12 lerela

Hi, thanks for reporting this. Right away, nothing really comes to mind about why this might be happening.

Just trying to narrow down the problem:

  • Do you have iframes on your website?
  • Can you share a bit more about how you initialize Sentry on your page?

lforst avatar Dec 15 '22 11:12 lforst

Thanks for your reply.

We use Chatwoot (live chat) which I believe makes use of iframes, even though we do not use them directly.

We configure Sentry using your snippet (upgrade to 7.26 broke the build so we had to change it) and we use sentry.client.config.js looks like this:

Sentry.init({
  dsn: env('SENTRY_DSN'),
  enabled: process.env.NODE_ENV !== 'development',
  environment: process.env.ENVIRONMENT | "dev",
  ignoreErrors: [
    "ResizeObserver loop limit exceeded",
    "ResizeObserver loop completed with undelivered notifications"
  ]
});

Feel free to close this issue if you feel this is coming from our application, I am wondering why would the stack trace only show Sentry SDK but that could definitely be something on our side.

lerela avatar Dec 15 '22 15:12 lerela

Ok what might be going on is that Chatwoot is using Sentry themselves inside the iframe and this is causing the issue. (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Property_access_denied)

Honestly, I am a bit lost myself at the moment how and why this is happening. We would definitely need to reproduce this somehow to fix it. We might also just do the same thing we did in https://github.com/getsentry/sentry-javascript/pull/3377 for the rest of the handlers.

lforst avatar Dec 15 '22 15:12 lforst

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 Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Jan 06 '23 00:01 github-actions[bot]

Hello, I have similar issues

image image

We use on project "@sentry/browser": "^7.81.1", "@sentry/tracing": "^7.81.1"

Config looks like:

 Sentry.init({
    dsn,
    tracesSampleRate,
    release,
    integrations: [new BrowserTracing()],
    initialScope: { tags: { service } },
    ignoreErrors: [ROUTE_CHANGE_ABORT_ERROR_MESSAGE],
    beforeSend: filterSentryData,
});

Can you help please ?

AnnPanasyuk avatar Mar 15 '24 12:03 AnnPanasyuk

@AnnPanasyuk Can you verify that the error is coming from within the SDK in your case? Thanks! I am asking because nothing you reported really points towards that.

lforst avatar Mar 15 '24 14:03 lforst

image

We use next in our project which loads by chunks sentry also

AnnPanasyuk avatar Mar 15 '24 15:03 AnnPanasyuk

@AnnPanasyuk what I meant is, can you verify that the error is actually caused by the SDK? It looks like the error is coming from your own code somewhere. I don't think there is anything we can do.

lforst avatar Mar 18 '24 09:03 lforst

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 remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

getsantry[bot] avatar May 16 '24 07:05 getsantry[bot]