'Protractor - ScriptTimeoutError: asynchronous script timeout: result was not received in 20 seconds

I'm new to Protractor and I am trying to run my script.

describe('Navigator homepage', function() {
  it('should proceed to login', function() {
    browser.get('url');
  });

  it('Clicks the proceed button', function() {
    const proceedButton = element(by.id('auth-login-page-button'));
    proceedButton.click();
  });
});

But whenever I run it the browser opens up and proceeds to the website and then waits for 20 sec and I get Error: ScriptTimeoutError: asynchronous script timeout: result was not received in 20 seconds. The element is clearly there and can be clicked, however not for the protractor. Am I doing something wrong? Config file looks like this:

// An example configuration file.
exports.config = {
  directConnect: true,

  // Capabilities to be passed to the webdriver instance.
  capabilities: {
    'browserName': 'chrome'
  },

  // Framework to use. Jasmine is recommended.
  framework: 'jasmine',

  // Spec patterns are relative to the current working directory when
  // protractor is called.
  specs: ['login_spec.js'],
  
  allScriptsTimeout: 20000,
  getPageTimeout: 15000,
  framework: 'jasmine',
  jasmineNodeOpts: {
    isVerbose: false,
    showColors: true,
    includeStackTrace: false,
    defaultTimeoutInterval: 40000
  }
};


Solution 1:[1]

I had a similar issue, I solved it by turning on ignore sync

browser.ignoreSynchronization = true

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Beyar