Tinkoff / micro-sentry

Tiny Sentry client with idiomatic wrapper for Angular
Apache License 2.0
118 stars 8 forks source link

[BUG] Not compatible with Angular Universal #8

Closed linusschwab closed 2 years ago

linusschwab commented 3 years ago

🐞 Bug report

Description

The current version of micro-sentry is not compatible with Angular Universal unfortunately. If an error is thrown during the server-side rendering, micro-sentry itself causes another error when trying to submit it to Sentry:

ReferenceError: window is not defined
   at micro_sentry_angular_MicroSentryService.getRequestBlank
   ...

This happens due to the window not being available server-side.

Reproduction

  1. Run micro-sentry server-side
  2. Make sure that an error is thrown during the app execution, for example by manually throwing one

Expected behavior

To avoid crashing during the error reporting, micro-sentry should include a simple platform check and either get the required error reporting data without using window or not include them if an error is thrown server-side.

Versions

Let me know if you have any questions or need any additional information 🙂

github-actions[bot] commented 2 years ago

:tada: This issue is included in version core@3.0.0-beta.1 :tada:

The release is available on GitHub release

github-actions[bot] commented 2 years ago

:tada: This issue is included in version browser@3.0.0-beta.1 :tada:

The release is available on GitHub release

github-actions[bot] commented 2 years ago

:tada: This issue is included in version angular@3.0.0-beta.1 :tada:

The release is available on GitHub release

tinkoff-bot commented 2 years ago

:tada: This issue is included in version core@3.0.0 :tada:

The release is available on GitHub release

tinkoff-bot commented 2 years ago

:tada: This issue is included in version browser@3.0.0 :tada:

The release is available on GitHub release

tinkoff-bot commented 2 years ago

:tada: This issue is included in version angular@3.0.0 :tada:

The release is available on GitHub release