js-api-loader icon indicating copy to clipboard operation
js-api-loader copied to clipboard

Uncaught SyntaxError: Unexpected token . in Electron

Open chriship opened this issue 1 year ago • 2 comments

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();

    })

chriship avatar May 24 '24 17:05 chriship

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:

This is an automated message, feel free to ignore.

wangela avatar May 24 '24 17:05 wangela

Which electron version are you using? Can you provide some more details about the error-message?

usefulthink avatar May 27 '24 16:05 usefulthink