The official Google Maps package ( @ google / maps ) is for nodes only. In a browser environment, you need to use an unofficial package or include an official script on your site.
If you encounter a ReferenceError problem, make sure the script tag for Google maps is above the script tag for your code so that it loads first. If this is not the case, your script may be run before the creation of the global Google variable.
One unofficial package is google-maps , which can be used in a browser.
source share