msw
msw copied to clipboard
"Cannot read properties of undefined (reading 'get')" when using generators/async generators as resolvers
Prerequisites
- [X] I confirm my issue is not in the opened issues
- [X] I confirm the Frequently Asked Questions didn't contain the answer to my issue
Environment check
- [X] I'm using the latest
mswversion - [X] 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
Expected behavior
According to the docs here: https://mswjs.io/docs/recipes/polling async generator should be supported
Note that there are 2 issues here:
- async generators are not allowed on the type level
- the test fails in runtime
Hi, @juliusmarminge. Thanks for reporting this!
I looked into it and indeed uncovered two issues in MSW that caused this. Addressed both in https://github.com/mswjs/msw/pull/2108. Also added missing integration tests for these cases.
Released: v2.3.3 🎉
This has been released in v2.3.3!
Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.
Predictable release automation by @ossjs/release.