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

pnpm resolves msw optional dependency as v2 instead of v1 #289

Closed
LavaToaster opened this issue Oct 23, 2023 · 4 comments · Fixed by #291
Closed

pnpm resolves msw optional dependency as v2 instead of v1 #289

LavaToaster opened this issue Oct 23, 2023 · 4 comments · Fixed by #291

Comments

@LavaToaster
Copy link

LavaToaster commented Oct 23, 2023

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?

@LavaToaster LavaToaster changed the title pnpm resolves optional dependency as v2 pnpm resolves msw optional dependency as v2 instead of v1 Oct 23, 2023
@VororRich
Copy link

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?

@pim
Copy link

pim commented Oct 27, 2023

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

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

@kettanaito
Copy link
Member

Using latest was completely incorrect. Will publish a fix.

@kettanaito
Copy link
Member

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.

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

Successfully merging a pull request may close this issue.

4 participants