Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError on www.visa.com.hk #14643

Open
adamraine opened this issue Jan 3, 2023 · 0 comments
Open

TypeError on www.visa.com.hk #14643

adamraine opened this issue Jan 3, 2023 · 0 comments

Comments

@adamraine
Copy link
Member

Moving #14631 (comment) to a separate issue. Content copied below:


Got similar issues on some URLs of www.visa.com.hk:

Ex: https://www.visa.com.kh/en_KH/travel-with-visa/destinations/paris.html

Running it on PageSpeed insights too.

edit

Digging the error locally this is due to a JS error on the page:

bundle.js?as:1 Unhandled promise rejection Error: TypeError: null is not a function
    at navigation.js:1:89935
    at navigation.js:1:89168
    at Object.throw (navigation.js:1:89273)
    at a (navigation.js:1:88062)

It somehow "leaks" in lighthouse:

Error: Evaluation exception: TypeError: null is not a function
    at t.exports (https://cdn.visa.com/cdn/scripts/cms-ui/bundle.js?as:1:84499)
    at new W (https://cdn.visa.com/cdn/scripts/cms-ui/bundle.js?as:1:146671)
    at t.then (https://cdn.visa.com/cdn/scripts/offers/elements.js:1:17224)
    at https://cdn.visa.com/cdn/scripts/cms-ui/bundle.js?as:1:147410
    at new W (https://cdn.visa.com/cdn/scripts/cms-ui/bundle.js?as:1:146707)
    at t.p.unsafe [as then] (https://cdn.visa.com/cdn/scripts/cms-ui/bundle.js?as:1:147388)
    at Promise.R.t.then (https://cdn.visa.com/cdn/scripts/offers/elements.js:1:18142)
    at ExecutionContext._evaluateInContext (/path/to/lighthouse/lighthouse-core/gather/driver/execution-context.js:116:29)

The exception is raised by:

    const response = await this._session.sendCommand('Runtime.evaluate', evaluationParams);
    if (response.exceptionDetails) {
      // An error occurred before we could even create a Promise, should be *very* rare.
      // Also occurs when the expression is not valid JavaScript.
      const errorMessage = response.exceptionDetails.exception ?
        response.exceptionDetails.exception.description :
        response.exceptionDetails.text;
      return Promise.reject(new Error(`Evaluation exception: ${errorMessage}`));
    }

Not sure how I could recover from this to simply "ignore" the issue like the browser does.

edit 2

In practice, every call to .evaluate() fails with this exception.

edit 3

Capture d’écran 2022-12-28 à 07 48 02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment