mapbox / mapbox/mapbox-gl-geocoder

When retrieving the location: There was an error reaching the server / 检索位置时候出现:There was an errorreaching the server错误

Open
#503 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged needs information
Dominant language
JavaScript
Stars
388
Forks
181
PR merge metrics
No merged PRs in 30d

Description

After I packaged and deployed the project, the location search function appeared: There was an error reaching the server error. I checked the network request and found that no token was carried, but I added it directly using MapboxGeocoder. How should I solve this situation?
我在项目打包部署后,地理位置搜索功能时出现:There was an errorreaching the server错误,我查看了网络请求,发现没有携带token,但是我是使用MapboxGeocoder直接添加的,这种情况应该怎么解决?
Method to realize/实现方式:
![image](https://github.com/mapbox/mapbox-gl-geocoder/assets/54367950/8b427ae0-d804-4919-a8ca-442c7b95f1cb)

error page:
![image](https://github.com/mapbox/mapbox-gl-geocoder/assets/54367950/90a6326e-3a71-47ac-982c-e3c025afe37b)

network:
![image](https://github.com/mapbox/mapbox-gl-geocoder/assets/54367950/f76e6a10-e6d4-41cd-916a-50ca56633b8a)

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 MapboxGeocoder setup described in the issue and inspect the deployed location-search network request shown in the screenshot. Compare the packaged deployment configuration with the request that succeeds during development; done means the deployed search request carries the required token and location search no longer reports a server error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.