cypress: Cypress hangs on Google Maps JavaScript API v3.52
Current behavior
Our Cypress tests in three apps randomly began failing today. As soon as a call was made using the Google Maps JavaScript API, the runner would freeze up until it would fail the test on the next cy call that relied on the maps response being successful.
We tracked it down to Google’s latest Maps SDK release 3.53. Pinning the version to 3.52 resolves the issue.
That is really all the information I have at this point. I am not even sure if this is a Cypress issue or if it falls on Google, but this does not happen outside of Cypress.
More info on versions: https://developers.google.com/maps/documentation/javascript/versions
Although I can’t provide a reproduction right now, I figured I would open the issue and hopefully save others from the hours of debugging I just had to do.
import { Loader } from "@googlemaps/js-api-loader"
const loader = new Loader({
apiKey: "YOUR_API_KEY",
- version: "weekly",
+ version: "3.52",
});
loader.load()
Or more commonly:
- <script src="https://maps.googleapis.com/maps/api/js?v=weekly&key=%VITE_PLACES_API_KEY%&libraries=places"></script>
+ <script src="https://maps.googleapis.com/maps/api/js?v=3.52&key=%VITE_PLACES_API_KEY%&libraries=places"></script>
Desired behavior
No response
Test code to reproduce
<script src="https://maps.googleapis.com/maps/api/js?v=weekly&key=%VITE_PLACES_API_KEY%&libraries=places"></script>
Cypress Version
12.11.0
Node version
18.16
Operating System
macOS
Debug Logs
No response
Other
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 10
- Comments: 19 (8 by maintainers)
Appears it’s already filed with @testing-library here. I used the posted workaround of updating getElementError in testing-library and it resolved the problem.
@higginsddh You can send them to
chris [at] cypress [dot] io. Thanks!@jsakas Thank you so much for finding this! I spent most of yesterday debugging our tests and I came up empty.