I'm using mapbox api for my application where user can add markers based on his current location. The map was loading just fine while it was running on localhost but after hosting it in netlify, all other components are loading but not the map. Even the markers on the map are showing but the map isn't showing up. This is my App link. There are some errors on the console. But I'm not sure what is causing this behavior. I saw a similar question before, but those solution didn't work for me. I even created a new api key, there were no URL restrictions. So any suggestions would be appreciated.
<ReactMapGL
mapboxApiAccessToken={process.env.REACT_APP_MAPBOX}
{...viewport}
onViewportChange={(nextViewport) => setViewport(nextViewport)}
mapStyle={process.env.REACT_APP_MAP_STYLE}
onDblClick={handleAddPlace}
transitionDuration={200}
>
{pins.map((pin, idx) => (
<div key={idx}>
<Marker
latitude={pin.lat}
longitude={pin.long}
offsetLeft={-viewport.zoom * 3.5}
offsetTop={-viewport.zoom * 7}
onClick={() => handlePinClick(pin._id, pin.lat, pin.long)}
>
<FaMapMarkerAlt
style={{
fontSize: viewport.zoom * 7,
color: pin.username === currentUser ? "#ff0984" : "#4f56a5",
cursor: "pointer",
}}
/>
</Marker>
...
</ReactMapGL>