Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.4.14 error - uncaughtException: TypeError: Cannot read property 'get' of undefined #54

Closed
Tracked by #1358
paales opened this issue Jul 20, 2022 · 4 comments
Closed
Tracked by #1358

Comments

@paales
Copy link

paales commented Jul 20, 2022

Describe the bug

This line throws and error: 2ea57a8#diff-e4b970f03575a2793030b90a4fba4c5034cfa2ebdfd4bd1454a8af2db0660b19R198

[next] error - uncaughtException: TypeError: Cannot read property 'get' of undefined
[next]     at Function.value (/Users/frank/Sites/project-vaessen-gc/node_modules/cross-undici-fetch/dist/create-node-ponyfill.js:198:26)
[next]     at new Headers (/Users/frank/Sites/project-vaessen-gc/node_modules/next/dist/compiled/node-fetch/index.js:1:56447)
[next]     at createHeadersLenient (/Users/frank/Sites/project-vaessen-gc/node_modules/next/dist/compiled/node-fetch/index.js:1:59685)
[next]     at ClientRequest.<anonymous> (/Users/frank/Sites/project-vaessen-gc/node_modules/next/dist/compiled/node-fetch/index.js:1:65909)
[next]     at ClientRequest.emit (events.js:400:28)
[next]     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:647:27)
[next]     at HTTPParser.parserOnHeadersComplete (_http_common.js:127:17)
[next]     at Socket.socketOnData (_http_client.js:515:22)
[next]     at Socket.emit (events.js:400:28)
[next]     at addChunk (internal/streams/readable.js:293:12)

To Reproduce
Steps to reproduce the behavior: use the latest version of graphql-mesh with nextjs.

Expected behavior
No errors 😉

Environment:

  • OS: Any
  • package-name...:
  • NodeJS: v16

Additional context

When adding a resolution to 0.4.13 it works:

  "resolutions": {
    "cross-undici-fetch": "0.4.13"
  },
@NicolasNewman
Copy link

NicolasNewman commented Jul 22, 2022

I'm encountering the same error using graphql-yoga/node v2.13.4

TypeError: Cannot read properties of undefined (reading 'get')
    at Function.value (/home/username/Project/node_modules/@graphql-yoga/node/node_modules/cross-undici-fetch/dist/create-node-ponyfill.js:198:26)
    at new Headers (/home/username/Project/node_modules/next/dist/compiled/node-fetch/index.js:1:54826)
    at createHeadersLenient (/home/username/Project/node_modules/next/dist/compiled/node-fetch/index.js:1:58064)
    at ClientRequest.<anonymous> (/home/username/Project/node_modules/next/dist/compiled/node-fetch/index.js:1:64288)
    at ClientRequest.emit (node:events:527:28)
    at ClientRequest.emit (node:domain:475:12)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:631:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
    at Socket.socketOnData (node:_http_client:494:22)
    at Socket.emit (node:events:527:28)
error - uncaughtException: TypeError: Cannot read properties of undefined (reading 'get')

@ryangoree
Copy link

I'm encountering the same error using graphql-yoga/node v2.13.4

TypeError: Cannot read properties of undefined (reading 'get')
    at Function.value (/home/username/Project/node_modules/@graphql-yoga/node/node_modules/cross-undici-fetch/dist/create-node-ponyfill.js:198:26)
    at new Headers (/home/username/Project/node_modules/next/dist/compiled/node-fetch/index.js:1:54826)
    at createHeadersLenient (/home/username/Project/node_modules/next/dist/compiled/node-fetch/index.js:1:58064)
    at ClientRequest.<anonymous> (/home/username/Project/node_modules/next/dist/compiled/node-fetch/index.js:1:64288)
    at ClientRequest.emit (node:events:527:28)
    at ClientRequest.emit (node:domain:475:12)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:631:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
    at Socket.socketOnData (node:_http_client:494:22)
    at Socket.emit (node:events:527:28)
error - uncaughtException: TypeError: Cannot read properties of undefined (reading 'get')

Same, looks like @graphql-yoga/node uses this as a dependency and works fine on it's own, but if you try to use fetch at any point after @graphql-yoga/node runs the cross-undici-fetch lib, it will throw the error.

ryangoree added a commit to delvtech/frontend-monorepo that referenced this issue Jul 26, 2022
ardatan/whatwg-node#54

Co-authored-by: Duke Nguyen <hnguyen1179@berkeley.edu>
ryangoree added a commit to delvtech/frontend-monorepo that referenced this issue Jul 26, 2022
ardatan/whatwg-node#54

Co-authored-by: Duke Nguyen <hnguyen1179@berkeley.edu>

Co-authored-by: Duke Nguyen <hnguyen1179@berkeley.edu>
@n1ru4l
Copy link
Collaborator

n1ru4l commented Jul 29, 2022

@n1ru4l
Copy link
Collaborator

n1ru4l commented Jul 29, 2022

This seems to be resolved within @whatwg-node/fetch@^0.2.6 (cross-undici-fetch got renamed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants