mswjs / http-middleware

Spawn an HTTP server from your request handlers or apply them to an existing server using a middleware.

Home Page:https://npm.im/@mswjs/http-middleware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compatability with MSW 2.0

tobeycodes opened this issue · comments

It seems that MockedRequest is no longer exported from v2.0

Hi, @tobeycodes. No, it's not. You shouldn't be using http-middleware with MSW 2.0. This library supports a specific range of msw:

"msw": "^1.1.0",

Pull requests are welcome to bump this package to support MSW 2.0!

@kettanaito @tobeycodes

https://github.com/kubb-project/kubb/blob/9fb2494ce81e19e436a571357fcd26f1d7e972b7/examples/msw-v2/src/server.ts

Did some changes on my own project related to this, maybe this can become a PR to resolve the issue around msw 2.x.x :)

@stijnvanhulle, can you please open a pull request with that? I was just looking at the source code and that is precisely what I would do. Your contribution would be appreciated!

@kettanaito @tobeycodes

Some building issues with the examples but tests and changes seem to work: #32