keplergl / kepler.gl

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

[Bug] module.exports = require('./dist/reducers') #2530

Open Virous77 opened 9 months ago

Virous77 commented 9 months ago

Describe the bug

I tried to setup kepler.gl locally in my project an defined, I followed the path and installed the dependencies but got the error related to module.exports = require('./dist/reducers') when i started the development server.

Image 27-02-24 at 10 07 PM

  "kepler.gl": "^3.0.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-palm": "^3.3.8",
    "react-redux": "^9.1.0",
    "redux": "^5.0.1"

To Reproduce Steps to reproduce the behavior:

All we have to setup new VITE project with above dependencies and setup store and start the project.

store.js

import { createStore, combineReducers, applyMiddleware } from "redux";
import keplerGlReducer from "kepler.gl/reducers";
import { taskMiddleware } from "react-palm/tasks";

function appReducer() {
  return {};
}
const initialState = {};

const keplerReducer = keplerGlReducer.initialState({
  uiState: {
    activeSidePanel: null,
    currentModal: null,
  },
});

const reducers = combineReducers({
  keplerGl: keplerReducer,
  app: appReducer,
});

export default createStore(
  reducers,
  initialState,
  applyMiddleware(taskMiddleware)
);

Desktop (please complete the following information):

  System:
    OS: macOS 14.3.1
    CPU: (8) arm64 Apple M1
    Memory: 142.66 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.6.1 - /opt/homebrew/bin/node
    Yarn: 1.22.21 - /opt/homebrew/bin/yarn
    npm: 10.2.4 - /opt/homebrew/bin/npm
  Browsers:
    Brave Browser: 121.1.62.165
    Firefox: 123.0
    Safari: 17.3.1

I tried in my linux system too but issue is same there.

mstevesmith commented 9 months ago

Not going to work with VITE.

Virous77 commented 9 months ago

Not going to work with VITE.

The problem was same with CRA too so I tried multiple version of Redux and Kepler at last i was able to run with these dependency.

{
  "name": "example",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "assert": "^2.1.0",
    "kepler.gl": "^2.5.5",
    "querystring": "^0.2.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-palm": "^3.3.8",
    "react-redux": "^7.2.0",
    "react-scripts": "^5.0.1",
    "react-table": "^7.8.0",
    "redux": "^4.2.1",
    "url": "^0.11.3"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
}

The only problem is right now i have to force install all dependency.