Clone Sample won’t work at npm start
git clone -b sample-place-search https://github.com/googlemaps/js-samples.git
A message like this kept showing up. If you clicked in docs, it only gave you useless instructions that won’t work even if you tried million times.
How to solve it?
Make sure you have Maps API Key and empty the others to troubleshoot.
npm run build /
vite build don’t use
.env to update your API key in
And, don’t forget to protect you key like mine here:
How to use GitHub Actions secrets to hide your tokens and passwords example
What if I want to use API key in
My example: (add a workflow to manually overwrite or create one
Set up your API key by Github Actions Secrets