mapbox / mapbox/mapbox-sdk-js

Cannot find module 'node_modules/@mapbox/mapbox-sdk/services/geocoding'

Open
#497 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
768
Forks
191
PR merge metrics
No merged PRs in 30d

Description

Locally, everything is working fine. I have an express server which uses the mapbox geocoding API for text-based location search.

I have the following installed in my package.json

  "dependencies": {
    "@mapbox/mapbox-sdk": "^0.16.1",
  },
  "devDependencies": {
    "@types/mapbox__mapbox-sdk": "^0.16.0",
  }

and this entry in my tsconfig.json:

    "types": [
      "jest",
      "@types/mapbox__mapbox-sdk"
    ]

However, as I run the server in production, I am getting this error:

Cannot find module '/node_modules/@mapbox/mapbox-sdk/services/geocoding' imported from /src/api/search/map-search.controller.js

mapbox is the only package which does not appear to work here. Note, that I am using TypeScript throughout my application here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the import in /src/api/search/map-search.controller.js and compare it with the @mapbox/mapbox-sdk dependency in package.json. Check the production installation and module-resolution behavior against the local TypeScript setup in tsconfig.json. Done means the geocoding module resolves and the server starts successfully in production.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, javascript, node.js, typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.