mswjs / data

Data modeling and relation library for testing JavaScript applications.

Home Page:https://npm.im/@mswjs/data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pnpm resolves msw optional dependency as v2 instead of v1

LavaToaster opened this issue · comments

Given the following package.json file:

{
    "dependencies": {
        "msw": "^1.2.3"
    },
    "devDependencies": {
        "@mswjs/data": "^0.13.0",
        "@mswjs/http-middleware": "^0.8.0",
        "@mswjs/interceptors": "^0.25.1"
    }
}

NPM, Yarn and PNPM are resolving the msw for @mswjs/data as either v1 or v2. In our case with PNPM it's resolving v2. Which then results in @mswjs/data being incompatible.

Should this be a peerDependency?

Should package.json have the devDependencies and optionalDependencies for MSW set to "^1.0.0" (instead of "latest") until a v2 fix/implementation is in place?

In the meantime adding this to package.json fixed it for me.

{
  "pnpm": {
    "overrides": {
      "@mswjs/data": "^1.0.0"
    }
}

Using latest was completely incorrect. Will publish a fix.

Released: v0.15.0 🎉

This has been released in v0.15.0!

Make sure to always update to the latest version (npm i @mswjs/data@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.