graphql-hive / graphql-hive/envelop

Cannot read properties of undefined (reading 'hrtime')

Open
#1,771 2 comments 0 reactions 0 assignees View on GitHub
good first issue help wanted kind/bug stage/3-local-solution
Dominant language
No language data
Stars
827
Forks
132
PR merge metrics
No merged PRs in 30d

Description

### Issue workflow progress

_Progress of the issue based on the
[Contributor Workflow](https://github.com/the-guild-org/Stack/blob/master/CONTRIBUTING.md#a-typical-contributor-workflow)_

- [ ] 1. The issue provides a
[minimal reproduction](https://en.wikipedia.org/wiki/Minimal_reproducible_example) available on
[Stackblitz](https://stackblitz.com/fork/node).
- _Please install the latest `@envelop/*` packages that you are using._
- _Please make sure the reproduction is as small as possible._
- [ ] 2. A failing test has been provided
- [ ] 3. A local solution has been provided
- [ ] 4. A pull request is pending review

---

**Describe the bug**

I get following error when I include apollo-tracing: `Cannot read properties of undefined (reading 'hrtime')`

Here's the more complete stack trace:

```
TypeError: Cannot read properties of undefined (reading 'hrtime')
at file:///Users/user/Documents/work/projects/some_project/node_modules/@envelop/apollo-tracing/esm/index.js:31:53
at field.resolve (file:///Users/user/Documents/work/projects/some_project/node_modules/@envelop/on-resolve/esm/index.js:18:56)
at resolveField (/Users/user/Documents/work/projects/some_project/node_modules/graphql/execution/execute.js:464:18)
at executeFields (/Users/user/Documents/work/projects/some_project/node_modules/graphql/execution/execute.js:292:18)
at executeOperation (/Users/user/Documents/work/projects/some_project/node_modules/graphql/execution/execute.js:236:122)
at executeImpl (/Users/user/Documents/work/projects/some_project/node_modules/graphql/execution/execute.js:116:14)
at execute (/Users/user/Documents/work/projects/some_project/node_modules/graphql/execution/execute.js:60:35)
at graphqlMiddleware (/Users/user/Documents/work/projects/some_project/node_modules/express-graphql/index.js:125:32)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
locations: [ { line: 4, column: 3 } ],
path: [ 'deals' ]
}

```
It seems to be failling here, with ctx being undefined for some reason.
image

This is an ESM nodejs project, in case it matters.

**Environment:**

- OS: macOS
- NodeJS: v16/v18
"@envelop/apollo-tracing": "^4.0.6",
"@envelop/core": "^3.0.6",

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.