Console flooded with RESPONSE LISTENER objects and image loading warnings on new v2.x project #2096
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
@kettanaito I was able to change the enableMocking method to the following which got rid of the second screenshot (warnings): async function enableMocking() {
if (import.meta.env.PROD) {
return Promise.resolve();
}
const {worker} = await import('./mocks/browser');
return worker.start({
quiet: true,
onUnhandledRequest: (request, print) => {
if (request.url.toString().startsWith(DEV_BASE_API_URL)) {
print.error();
}
},
});
} However, the first logs are still happening. I looked at the source and it looks like they are originating here ( ) but i don't see anywhere that you can disable that log. How can i disable that so that I don't get flooded with these requests, especially since i'm now pinpointing the unhandled responses to my API url (the API is at'http://localhost:3000/api' while these requests come from 'http://localhost:3000/images/*' and 'http://localhost:3000/fonts/*' (these are paths in the public directory where my Vite assets are being pulled from during development).
|
Beta Was this translation helpful? Give feedback.
-
@reintroducing, regarding the second screenshot, Instead, use a custom |
Beta Was this translation helpful? Give feedback.
@reintroducing, regarding the second screenshot,
bypass
is not the solution. You still want to be warned about the requests you don't handle so they don't slip past your eyes.Instead, use a custom
onUnhandledRequest()
predicate function: