Skip to content

bug: missing NEXT_PUBLIC_MAPTILER_KEY silently renders a gray, dead map #147

Description

@shauryagangrade

Problem

src/components/map/map-view.tsx:448 interpolates the key straight into the tile URL:

url={`https://api.maptiler.com/maps/${tileVariant}/256/{z}/{x}/{y}{r}.png?key=${process.env.NEXT_PUBLIC_MAPTILER_KEY}`}

If the env var is unset (fresh fork, self-host following SELF-HOSTING.md but skipping the key step), the URL becomes ...?key=undefined, MapTiler returns 403 for every tile, and the user just sees a gray void — no warning, no hint about what's wrong.

Suggested fix

  • In dev, log a loud console warning when the variable is missing/empty
  • Optionally surface a visible error/empty state ("Basemap unavailable — is NEXT_PUBLIC_MAPTILER_KEY set? See SELF-HOSTING.md") instead of silent gray tiles
  • Mention the failure mode explicitly in SELF-HOSTING.md troubleshooting

Acceptance criteria

  • Missing key produces an actionable message (dev console at minimum)
  • SELF-HOSTING.md documents the symptom

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersself-hostSelf-host / bring-your-own-data

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions