Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing docs in response to react-map-gl named export change #9427

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ironicbrew
Copy link

Background

I was working with deck.gl for the first time and wasn't able to get the "getting started" example working. Turns out the latest version of react-map-gl (8.x) doesn't export anything from "." you have to use 'react-map-gl/{'mapbox' | 'maplibre' | mapbox-legacy'} etc.

Reproduction instructions

  • Using react-map-gl 8.0.1 try to implement the deck.gl react example using using import Map from 'react-map-gl'
  • Terminal will error with: Internal server error: Failed to resolve entry for package "react-map-gl". The package may have incorrect main/module/exports specified in its package.json: Missing "." specifier in "react-map-gl" package

Additional Context

If you look in node_modules the package.json of react-map-gl contains the following:

  "exports": {
    "./mapbox": {
      "types": "./dist/mapbox.d.ts",
      "require": "./dist/mapbox.cjs",
      "import": "./dist/mapbox.js"
    },
    "./maplibre": {
      "types": "./dist/maplibre.d.ts",
      "require": "./dist/maplibre.cjs",
      "import": "./dist/maplibre.js"
    },
    "./mapbox-legacy": {
      "types": "./dist/mapbox-legacy/index.d.ts",
      "require": "./dist/mapbox-legacy/index.cjs",
      "import": "./dist/mapbox-legacy/index.js"
    }
  },

Change List

  • I updated everywhere in the docs I believe the import to be outdated

@coveralls
Copy link

coveralls commented Feb 17, 2025

Coverage Status

coverage: 91.607%. remained the same
when pulling 9d7fdee on ironicbrew:master
into 95884c4 on visgl:master.

Copy link
Collaborator

@felixpalmer felixpalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants