No fetch calls on Edge 16/17/18 or iOS10 after transpiling to esmodules
See original GitHub issueIs there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Self-hosted/on-premise
Which package are you using?
SDK Version
7.7.0
Framework Version
No response
Link to Sentry event
No response
Steps to Reproduce
- 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 include @sentry packages via
exclude: /node_modules\/(?!(@sentry)\/).*/,
(we normally exclude node_modules). Our@babel/present-env
target istargets: { esmodules: true },
- After this new build, those browsers started loading our pages okay.
- 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:
- Add option to nextjs SDK (https://github.com/getsentry/sentry-javascript/pull/5472)
- Document nextjs option and document necessary build pipeline changes for non-nextjs people (https://github.com/getsentry/sentry-docs/pull/5350)
Issue Analytics
- State:
- Created a year ago
- Comments:28 (11 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.