Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource

In the connect method of my Stimulus controller I have this code:

box.addEventListener("input", e => {
   Turbo.visit("/search/" + box.value, {action: "replace"}));
});

box is a text input field and I try to update a results frame while typing. This works fine as long as I type slowly, but when typing quicker, I get the following error:

Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource.

I’m not a JS expert, but to me it looks like multiple visits are triggered and somehow conflict with each other. Am I doing something wrong? I did not found an option to wait for an active visit to finish or to cancel an ongoing one.

Don’t think so. A network simply means network isn’t reachable. Can you visit the url normally?

Yes, it is talking to a simple app running locally on my machine. As I wrote: It depends on the typing speed.