Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Install mws without graphql #1166

Closed
1 task done
Flui opened this issue Mar 15, 2022 · 1 comment
Closed
1 task done

Install mws without graphql #1166

Flui opened this issue Mar 15, 2022 · 1 comment
Labels

Comments

@Flui
Copy link

Flui commented Mar 15, 2022

Scope

Adds a new behavior

Compatibility

  • This is a breaking change

Feature description

Is your feature request related to a problem? Please describe.

Currently I am working on an Project with react-scripts@4.0.3 and typescript@3.8.3. After installing latest version of msw I get the following typescript error:
"Package 'graphql' support only TS versions that are >=4.1.0"
As I am consuming a rest api via fetch, there is no need for me here to even install graphql.

Describe the solution you'd like

So I would like to install msw with the minimal required dependencies to use it for rest apis.

Describe alternatives you've considered

If somebody has a workaround without updating typescript I would appreciate that as well.

@Flui Flui added the feature label Mar 15, 2022
@kettanaito
Copy link
Member

Hey, @Flui.

While I understand your concern, MSW is a devtool, and its dependencies are bound to the goals it accomplishes. I understand you may not use GraphQL mocking in your project. Yet the price you pay for installing an extra package is rather small.

In a similar fashion, we're installing packages to manage cookies, which you may not mock. There's no agreed way to modularize libraries in Node.js, so you will end up installing more than you may potentially use and it's fine.

If you get a warning from a tool you're not using, you can just ignore that warning. The one you're getting is interesting though, because it suggests you're using TypeScript < 4.1.0. MSW requires TypeScript 4.3 to run, so you have to update TypeScript if you want to use MSW without issues.

We are working on communicating the required TypeScript version more clearly in #985.

@mswjs mswjs locked and limited conversation to collaborators Mar 15, 2022
@kettanaito kettanaito converted this issue into discussion #1167 Mar 15, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants