title: _locale.cy.request is not a function
body: <p>I'm trying to create a basic login command in Cypress, which was working when I used cy.visit().</p>
  
  <p>After reading up on Cypress, I found out that logging in using the UI is an anti-pattern, so I'm attempting to switch over to calling cy.request() to post to the login route.</p>
  
  <p>However, when I try this, I get an error that does not make sense to me:</p>
  
  <p><code>TypeError: _locale.cy.request is not a function</code></p>
  
  <p>This is my code in commands.js:</p>
  
  <pre><code>Cypress.Commands.add("login", () =&gt; {
    cy.request('POST', `${Cypress.config().baseUrl}/login`, {username: 'sysadmin', password: 'test'});
  });
  </code></pre>
  
  <p>And this is where it gets called in the test:</p>
  
  <pre><code>it('Logs in successfully', () =&gt; {
    cy.login();
  });
  </code></pre>
  
  <p>From my understanding, cy.request is a function that comes with Cypress, that can take in a method, url and body: <a href="https://docs.cypress.io/api/commands/request.html#Syntax" rel="nofollow noreferrer">https://docs.cypress.io/api/commands/request.html#Syntax</a>.</p>
  
  <p>Can anyone please explain why Cypress isn't recognizing its own native function?</p>
  
  <p>Thanks</p>