I am using @react-google-maps/api with react js
I’ve a problem on production with useLoadScript hook, isLoaded returning false with the following error
Refused to load the script 'https://maps.googleapis.com/maps/api/js?key=[key]&v=weekly&callback=initMap' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
Packages
"react": "^17.0.2",
"@react-google-maps/api": "^2.18.1",
Component Code
import { GoogleMap, Marker, useLoadScript } from "@react-google-maps/api";
const { isLoaded, loadError } = useLoadScript({
googleMapsApiKey: process.env.REACT_APP_GOOGLE_MAPS_KEy,
});
Please help.