question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No fetch calls on Edge 16/17/18 or iOS10 after transpiling to esmodules

See original GitHub issue

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which package are you using?

@sentry/react

SDK Version

7.7.0

Framework Version

No response

Link to Sentry event

No response

Steps to Reproduce

  1. When upgrading to v7 and above, Edge 16/17/18 and iOS 10 safari would no longer load our pages.
  2. So I set webpack to include @sentry packages via exclude: /node_modules\/(?!(@sentry)\/).*/, (we normally exclude node_modules). Our @babel/present-env target is targets: { esmodules: true },
  3. After this new build, those browsers started loading our pages okay.
  4. When I view the response to captureMessage it appears to work fine, I get an event_id returned.

Expected Result

I expect the network calls to be made to register these event_id’s on all browsers

Actual Result

No network request is made in Edge 16/17/18 or iOS 10 Safari, so these events never get to Sentry.

In more modern browsers I do get the network requests and they work as normal in Sentry.


Internal tracking:

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:28 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
lobsterkatiecommented, Jul 27, 2022

Update: We discussed it and for nextjs we’re going to include my hack in the SDK proper, enabled via a config option (see the linked PR above). For everyone else, we’ll document what needs to be done, but (other than in nextjs) we can’t change folks’ build pipelines, so the fix will have to be on their end.

2reactions
lobsterkatiecommented, Jul 25, 2022

Hi, all.

I’m pretty sure I know the culprit here. We use object spread syntax in the SDK, which none of those browsers support.

As far as fixing it goes, a) I tried the package Lukas linked, and it doesn’t seem to work, but b) I hacked together something which seems to, and we’re going to discuss tomorrow in our standup whether we want to include it in the SDK or just document it as a workaround.

I’ll update once we’ve made a decision.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No fetch calls on Edge 16/17/18 or iOS10 after transpiling to ...
When upgrading to v7 and above, Edge 16/17/18 and iOS 10 safari would no longer load our pages. So I set webpack to...
Read more >
Node Modules at War: Why CommonJS and ES ... - Code Red
Since CJS doesn't support top-level await , it's not even possible to transpile ESM top-level await into CJS. How would you rewrite this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found