Skip to content

[MSW] Warning: intercepted a request without a matching request handler: #549

Description

@Joseamica

Im using this stack for my main project, but when I use fetch I get a bunch of warnings, around 10x this message:

Read more: https://mswjs.io/docs/getting-started/mocks
GET /dashboard/tables?_data=routes/dashboard+/tables 200 - - 118.309 ms
GET /dashboard/tables?_data=root 200 - - 6.871 ms
[MSW] Warning: intercepted a request without a matching request handler:

  • GET https://av.fly.dev/api/clmp0brnr000dq39v4379wyp0/tables

If you still wish to intercept this unhandled request, please create a request handler for it.
Read more: https://mswjs.io/docs/getting-started/mocks
GET /dashboard/tables?_data=routes/dashboard+/tables 200 - - 91.385 ms
[MSW] Warning: intercepted a request without a matching request handler:

  • GET https://av.fly.dev/api/clmp0brnr000dq39v4379wyp0/tables

If you still wish to intercept this unhandled request, please create a request handler for it.
Read more: https://mswjs.io/docs/getting-started/mocks
GET /dashboard/tables?_data=root 200 - - 12.040 ms
GET /dashboard/tables?_data=routes/dashboard+/tables 200 - - 108.198 ms
GET /dashboard/tables?_data=root 200 - - 12.283 ms
[MSW] Warning: intercepted a request without a matching request handler:

  • GET https://av.fly.dev/api/clmp0brnr000dq39v4379wyp0/tables

If you still wish to intercept this unhandled request, please create a request handler for it.
Read more: https://mswjs.io/docs/getting-started/mocks
GET /dashboard/tables?_data=routes/dashboard+/tables 200 - - 68.092 ms

Also, when i just reload the app i get a lot of get requests

GET / 200 - - 33.989 ms
GET /?_data=root 200 - - 17.430 ms
GET /?_data=root 200 - - 2.206 ms
GET /?_data=root 200 - - 3.146 ms

Activity

  1. ananni13 commented on Dec 7, 2023

    @ananni13
    Contributor

    The warnings come from MSW, the mock server that is launched alongside the app server during development (see server/dev-server.js, index.js and tests/mocks/index.ts).

    It intercepts all outgoing requests, and since you're making GET requests to https://av.fly.dev and you haven't defined a mock handler for that endpoint, you get the warning.

    You can take a look in the mocks folder for examples on how to define handlers.

    Also, when i just reload the app i get a lot of get requests

    GET / 200 - - 33.989 ms
    GET /?_data=root 200 - - 17.430 ms
    GET /?_data=root 200 - - 2.206 ms
    GET /?_data=root 200 - - 3.146 ms

    This is Remix calling loaders and revalidating data, multiple requests might be related to client-hints cookies:

  2. locked and limited conversation to collaborators on Dec 8, 2023
  3. converted this issue into a discussion #552 on Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions