I tried creating a new API token and pasted it in a .env file and updated the jsx file imports,
const Dashboard = () => {
const navigate = useNavigate();
const [user, setUser] = useState(null);
const [loading, setLoading] = useState(true);
const [viewport, setViewport] = useState({
latitude: 6.9318,
longitude: 79.8863,
zoom: 10,
});
<ReactMapGL
{...viewport}
mapStyle="mapbox://styles/mapbox/streets-v11"
onViewportChange={setViewport}
width="100%"
height="100%"
mapboxApiAccessToken={import.meta.env.VITE_MAPBOX_ACCESS_TOKEN}
/>
}