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

"Cannot read properties of undefined (reading 'get')" when using generators/async generators as resolvers #2109

Open
4 tasks done
juliusmarminge opened this issue Mar 25, 2024 · 2 comments · May be fixed by #2108
Open
4 tasks done
Assignees
Labels
bug Something isn't working scope:node Related to MSW running in Node

Comments

@juliusmarminge
Copy link

Prerequisites

Environment check

  • I'm using the latest msw version
  • I'm using Node.js version 18 or higher

Node.js version

20.11

Reproduction repository

https://github.com/juliusmarminge/msw-async-generator

Reproduction steps

bun i && bun run test

Current behavior

CleanShot 2024-03-25 at 13 01 38@2x

Expected behavior

According to the docs here: https://mswjs.io/docs/recipes/polling async generator should be supported

@juliusmarminge juliusmarminge added bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node labels Mar 25, 2024
@juliusmarminge
Copy link
Author

Note that there are 2 issues here:

  1. async generators are not allowed on the type level
  2. the test fails in runtime

@kettanaito
Copy link
Member

Hi, @juliusmarminge. Thanks for reporting this!

I looked into it and indeed uncovered two issues in MSW that caused this. Addressed both in #2108. Also added missing integration tests for these cases.

@kettanaito kettanaito self-assigned this Mar 25, 2024
@kettanaito kettanaito removed the needs:triage Issues that have not been investigated yet. label Mar 25, 2024
@kettanaito kettanaito changed the title bug: async generator doesn't work "Cannot read properties of undefined (reading 'get')" when using generators/async generators as resolvers Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scope:node Related to MSW running in Node
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants