keplergl / kepler.gl

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
http://kepler.gl
MIT License
10.42k stars 1.75k forks source link

kepler 3 doesn't work with yarn add #2671

Open luca-moscatelli opened 1 month ago

luca-moscatelli commented 1 month ago

Describe the Bug

I'm encountering an issue while trying to compile Kepler.gl version 3 in my project. I installed Kepler.gl using yarn add kepler.gl and followed the exact configuration provided in the README to set it up in App.tsx. However, I receive the following error during compilation:

Error: Failed to scan for dependencies from entries:
  C:/Users/LucaMoscatelli/progetti/kepler3_gmatics_vite/index.html

  X [ERROR] Failed to resolve entry for package "kepler.gl". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-scan]

  (Detailed error log follows...)

The error suggests that the package "kepler.gl" might have incorrect entry points specified in its package.json, leading to a failure during the dependency scan.

This issue was triggered by the following import statement in src/App.jsx:

import KeplerGl from 'kepler.gl';

Additionally, I encountered similar issues with other dependencies such as react-redux and redux-thunk:

X [ERROR] Failed to resolve entry for package "react-redux". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-scan]
...
X [ERROR] Failed to resolve entry for package "redux-thunk". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-scan]

To Reproduce
Steps to reproduce the behavior:

  1. Install Kepler.gl version 3 using yarn add kepler.gl.
  2. Import KeplerGl in App.tsx as specified in the README.
  3. Run the Vite development server using yarn dev.
  4. Observe the errors during the dependency scan.

Expected Behavior
I expected Kepler.gl to compile correctly without dependency resolution errors, and the application to load without issues.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional Context
I tried several solutions, including:

None of these attempts fixed the problem. It seems that Kepler.gl version 3 might require a different configuration compared to previous versions, particularly when used with Vite.

If anyone has successfully integrated Kepler.gl version 3 with Vite, or knows what could be causing these issues, I would appreciate your help. Thanks in advance!

indranildeveloper commented 3 weeks ago

The import for Kepler GL Component should be from @kepler.gl/components and this package should be installed separately.

So your import should look something like this:

import KeplerGl from "@kepler.gl/components";

Not only that if you are using the actions or constants that should be installed separately as well.

I hope that helps :)