`
'use client';
import 'leaflet/dist/leaflet.css';
import MarkerClusterGroup from "react-leaflet-cluster";
import {MapContainer, Marker, Popup, TileLayer} from "react-leaflet";
import logo from '@/assets/images/images/small-logo.png'
import cart from "@/assets/images/vectors/cart.svg";
import SecondaryButton from "@/components/Buttons/SecondaryButton/SecondaryButton";
When I build project catch error
window is not defined
package.json "dependencies": { "leaflet": "^1.9.4", "leaflet.markercluster": "^1.5.3", "next": "14.1.0", "react": "^18", "react-dom": "^18", "react-google-recaptcha": "^3.1.0", "react-hook-form": "^7.50.1", "react-leaflet": "^4.2.1", "react-leaflet-cluster": "^2.1.0", "react-slider": "^2.0.6", "swiper": "^11.0.5" },
component
` 'use client'; import 'leaflet/dist/leaflet.css'; import MarkerClusterGroup from "react-leaflet-cluster"; import {MapContainer, Marker, Popup, TileLayer} from "react-leaflet";
import logo from '@/assets/images/images/small-logo.png' import cart from "@/assets/images/vectors/cart.svg"; import SecondaryButton from "@/components/Buttons/SecondaryButton/SecondaryButton";
import Image from "next/image";
export default function MyMap() {
`, })}>
} `
const Map = useMemo(() => dynamic( () => import('@/components/Map/Map'), { loading: () => <p>A map is loading</p>, ssr: true } ), [])