[Bug] Mapbox geocoder example crashes: "i is not a function"

オープン
#2,628 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@yuiseki がすでに取り組んでいます。

2026年11月11日 から。

  • #2629 @yuiseki による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
node.js, react, typescript, webpack
領域
frontend, web-dev

調査の方向性

Start with the website's webpack configuration and how it resolves the nested nanoid dependency used by @mapbox/mapbox-gl-geocoder. Reproduce by opening the Mapbox geocoder example at /examples/mapbox/geocoder and check whether the control renders without the reported TypeError. Done means the example loads with the geocoder control; pull request #2629 is already open against this issue.

索引モデルが issue の本文から書いたものです。

説明

Description

The Mapbox geocoder example on the website crashes on load with TypeError: i is not a function.

The error is thrown in generateSessionID() of @mapbox/[email protected], which calls require('nanoid')() and expects nanoid@2. The website's webpack config sets resolve.modules to absolute paths (from @vis.gl/docusaurus-website), so the nested nanoid@2 is skipped and the hoisted nanoid@3 is bundled. nanoid@3 has no default export.

image
Expected Behavior

The example renders a map with the geocoder control.

Steps to Reproduce

Open https://visgl.github.io/react-map-gl/examples/mapbox/geocoder

Environment
Logs
TypeError: i is not a function
    at generateSessionID
    at onAdd
    at addControl
主要言語
TypeScript
スター
8.5k
フォーク
1.3k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

visgl/react-map-gl のほかの issue

visgl/react-map-gl の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。