envelop: [useSentry] @sentry/ >= 6.18.x causes runtime error
Issue workflow progress
Progress of the issue based on the Contributor Workflow
- 1. The issue provides a minimal reproduction available on Stackblitz.
- Please install the latest
@envelop/*
packages that you are using. - Please makee sure the reproduction is as small as possible.
- Please install the latest
- 2. A failing test has been provided
- 3. A local solution has been provided
- 4. A pull request is pending review
Describe the bug
While refactoring my code to use Pothos, I noticed using @envelop/sentry
result in
{
"errors": [
{
"message": "Cannot read properties of undefined (reading 'setData')"
}
]
}
To Reproduce Just use sentry plugin with Pothos framework, exemple repo https://stackblitz.com/edit/node-qabanz?file=package.json
Expected behavior No Error
Environment:
- OS:
MacOS
- NodeJS:
17
&16
@envelop/sentry
:3.1.1
@envelop/core
:2.1.0
Additional context
I am also using this as server
@graphql-ez/express
: 0.9.7
,
@graphql-ez/plugin-websockets
: 0.10.4
,
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 18 (8 by maintainers)
This is linked to https://github.com/getsentry/sentry-javascript/issues/4731
I created https://github.com/dotansimha/envelop/pull/1367 with a failing test.
Currently, a workaround seems to be adding a
import "@sentry/tracing"
.I reduced the reproduction further in https://stackblitz.com/edit/node-kwtsm9?file=src/index.ts
This is not related to pothos at all. I will update the title of this issue.
So according to https://github.com/getsentry/sentry-javascript/issues/4731#issuecomment-1126157027, Sentry, unfortunately, shipped a major breaking change in a minor/patch release.
I updated the documentation to reflect that change in https://github.com/n1ru4l/envelop/pull/1407.
@HashDot
^6.18.1
will resolve to6.19.3
. You need to pin to the exact version6.18.1
.See https://semver.npmjs.com/ for more information as well as https://docs.npmjs.com/about-semantic-versioning
In regards to fixing this issue, it seems like there is an unexpected breaking change within sentry. I quickly scanned the sentry issues but could not find one. I will dedicate more time to this issue next week. In the meantime, any help or research (of the sentry changes) is highly appreciated.
I tested with
6.18.1
for sentry package and3.1.1
for@envelop/sentry
and it’s working as @MattiaPette said