-
Notifications
You must be signed in to change notification settings - Fork 67
Labels
priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
When loading the maps library followed by another library using loader.importLibrary()
and async/await syntax, a misleading warning-message "Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."
is written to the console.
Here's the code that triggers this behavior:
import Loader from '@googlemaps/js-api-loader';
async function main() {
const loader = new Loader({apiKey: 'MY_API_KEY'});
const {Map} = await loader.importLibrary('maps');
// this line will trigger the warning message:
await loader.importLibrary('marker');
}
The reason appears to be that the done
flag isn't correctly set to true
after the maps-api has initially been loaded.
lorenzo373, hitarthdesai, SimonOyaneder, Yahav, jparksecurity and 7 more
Metadata
Metadata
Assignees
Labels
priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.