title: What is "Must be handling a user gesture to show a permission request." errror message in Chrome Web Serial API?
body: <p>I am a real beginner when it comes to programming. It is my intention to control a device with the API integrated in Google Chrome via the COM port RS485. I try to reproduce the following tutorial: <a href="https://web.dev/serial/" rel="nofollow noreferrer">https://web.dev/serial/</a></p>
  <p>The following error message appears in the console:</p>
  <p>&quot;Uncaught (in promise) DOMException: Failed to execute 'requestPort' on 'Serial': Must be handling a user gesture to show a permission request.&quot;</p>
  <p>How can I fix this error?</p>
  <p>Thank you very much for your help.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="de"&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;title&gt;examplepage&lt;/title&gt;
      &lt;script&gt;
      async function caller() {
          // Prompt user to select any serial port.
      const port = await navigator.serial.requestPort();
  
      // Wait for the serial port to open.
      await port.open({ baudRate: 9600 });
      };
      
      if ("serial" in navigator) {
    alert("Your browser supports Web Serial API!");
    caller();
  }
      else {alert("Your browser does not support Web Serial API, the latest version of Google Chrome is recommended!");};
      
      
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
    
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>