(Created on )

Puppeteer: Invalid latitude '{value}': precondition -90 <= LATITUDE <= 90 failed.

Latitude is outside the accepted -90 to 90 range.


Latitude is outside the accepted -90 to 90 range.

Error message

Invalid latitude '{value}': precondition -90 <= LATITUDE <= 90 failed.

{value} is replaced by the value shown in your error message.

How this error happens

latitude must be -90 to 90 degrees. Invalid coordinates are rejected instead of being normalized.

The snippets use an open Puppeteer page named page.

await page.setGeolocation({
    latitude: 91,
    longitude: 2.3522,
    accuracy: 10,
});

How to fix

Validate the input and pass a value within the accepted range.

await page.setGeolocation({
    latitude: 48.8566,
    longitude: 2.3522,
    accuracy: 10,
});

Things to keep in mind

A valid location override does not grant geolocation permission. Grant that permission separately for the origin being tested.

All Puppeteer errors

Keep Reading

Puppeteer Guides

All Guides →