Skip to content

ERROR ReferenceError: google is not defined #26159

Closed
@TLKG

Description

@TLKG

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Installed packages and dependencies:

npm install @angular/google-maps@14.2
npm install @types/google.maps

In .ts file

import { GoogleMap, MapGeocoder } from '@angular/google-maps';

var g = new google.maps.Geocoder();  // <-- causing error.

DEBUG CONSOLE:

at executeInitAndCheckHooks (c:\project\node_modules\@angular\core\fesm2015\core.mjs:2411:9)
at refreshView (c:\project\node_modules\@angular\core\fesm2015\core.mjs:12013:21)
at refreshEmbeddedViews (c:\project\node_modules\@angular\core\fesm2015\core.mjs:13026:17)
at refreshView (c:\project\node_modules\@angular\core\fesm2015\core.mjs:12022:9)
at refreshComponent (c:\project\node_modules\@angular\core\fesm2015\core.mjs:13072:13)

Reproduction

Steps to reproduce:
1.
2.

Expected Behavior

no error

Actual Behavior

ReferenceError: google is not defined

Environment

  • Angular: 14.2
  • CDK/Material: 13.2
  • Browser(s): Chrome Version 107.0.5304.108 (Official Build) (64-bit)
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10
  • VSC Version: 1.73.1 (user setup)
  • Date: 2022-11-09T04:27:29.066Z
  • Electron: 19.0.17
  • Chromium: 102.0.5005.167
  • Node.js: 16.14.2
  • V8: 10.2.154.15-electron.0
  • OS: Windows_NT x64 10.0.19044

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions