js-api-loader
js-api-loader copied to clipboard
Uncaught SyntaxError: Unexpected token . in Electron
I have a Vue app which I am bundling using Electron into a Windows exe.
For a number of years the following code has worked. Recently is has stopped with an Unexpected token error when calling this.loader.load()
Note, this code works when I run it in the browser. It does not work when I run it using Electron (both using electron:serve and electron:build).
I've upaded to "@googlemaps/js-api-loader": "^1.16.6" and still the same. Previously I was using "^1.12.1".
Does anyone have an ideas how I can get it working again?
this.loader = new Loader({
apiKey: "...",
version: "weekly",
libraries: ["places"]
});
this.mapOptions = {
mapId: "54a1eec626be752c",
disableDefaultUI: true,
zoom: this.ZOOM,
zoomControl: true,
center: this.CENTER,
backgroundColor: '#9bbff4'
};
this.loader.load().then((google) => {
this.google = google
this.map = new google.maps.Map(document.getElementById("map"), this.mapOptions);
this.geocoder = new google.maps.Geocoder();
})
If you would like to upvote the priority of this issue, please comment below or react on the original post above with :+1: so we can see what is popular when we triage.
@chriship Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:
- Check the issue tracker - bugs and feature requests for Google Maps Platform APIs and SDKs
- Open a support case - Get 1:1 support in Cloud Console.
- Discord - chat with other developers
- StackOverflow - use the
google-mapstag
This is an automated message, feel free to ignore.
Which electron version are you using? Can you provide some more details about the error-message?