mapbox / mapbox-sdk-js

A JavaScript client to Mapbox services, supporting Node, browsers, and React Native
Other
719 stars 186 forks source link

ReferenceError: MapboxGeocoder is not defined #436

Open sarahk opened 2 years ago

sarahk commented 2 years ago

React/NextJS

In my component, I start by trying to import

import mbxGeocoding from '@mapbox/mapbox-sdk/services/geocoding';

and the linter tells me

Could not find a declaration file for module '@mapbox/mapbox-sdk/services/geocoding'.

Where am I going wrong?

package.json

"dependencies": {
    "@dnd-kit/core": "^5.0.3",
    "@dnd-kit/sortable": "^6.0.1",
    "@dnd-kit/utilities": "^3.1.0",
    "@mapbox/mapbox-sdk": "^0.12.1",
    "axios": "^0.26.1",
    "daisyui": "^2.13.4",
    "date-fns": "^2.28.0",
    "firebase": "^9.6.4",
    "mapbox-gl": "^2.8.2",
    "next": "^12.1.2",
    "nookies": "^2.5.2",
    "react": "17.0.2",
    "react-data-table-component": "^7.4.7",
    "react-datepicker": "^4.6.0",
    "react-dom": "^17.0.2",
    "react-firebase-hooks": "^5.0.3",
    "react-geolocated": "^3.2.0",
    "react-hook-form": "^7.28.1",
    "react-hot-toast": "^2.2.0",
    "react-markdown": "^8.0.0",
    "react-scripts": "^5.0.1",
    "react-select": "^5.2.2",
    "styled-components": "^5.3.5",
    "use-reducer-async": "^2.1.0"
  },
  "devDependencies": {
    "@svgr/webpack": "^6.2.1",
    "autoprefixer": "^10.4.2",
    "eslint": "8.12.0",
    "eslint-config-next": "^12.0.1",
    "eslint-plugin-react-hooks": "^4.4.0",
    "postcss": "^8.4.5",
    "tailwind-watch": "^0.0.6",
    "tailwindcss": "^3.0.15",
    "tailwindcss-debug-screens": "^2.2.1"
  }
}