Skip to content

Uncaught SyntaxError: Unexpected token . in Electron #848

Open
@chriship

Description

@chriship

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

    })

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs more infoThis issue needs more information from the customer to proceed.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions