mapbox / mapbox/mapbox-gl-geocoder
When retrieving the location: There was an error reaching the server / 检索位置时候出现:There was an errorreaching the server错误
Nobody has claimed this yet.
- 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/实现方式:

error page:

network:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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