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

Error Can't resolve 'lodash/isEqual' #122

Open
kolarski opened this issue Dec 27, 2022 · 6 comments · May be fixed by #132
Open

Error Can't resolve 'lodash/isEqual' #122

kolarski opened this issue Dec 27, 2022 · 6 comments · May be fixed by #132

Comments

@kolarski
Copy link

kolarski commented Dec 27, 2022

I'm getting error, on a clean project install:

error - ./node_modules/react-gauge-chart/dist/GaugeChart/customHooks.js:8:0
Module not found: Can't resolve 'lodash/isEqual'

Import trace for requested module:
./node_modules/react-gauge-chart/dist/GaugeChart/index.js
./node_modules/react-gauge-chart/dist/index.js
./pages/index.tsx

https://nextjs.org/docs/messages/module-not-found
error - Error [ERR_REQUIRE_ESM]: require() of ES Module /home/projects/p1/node_modules/d3/src/index.js from /home/projects/p1/node_modules/react-gauge-chart/dist/GaugeChart/index.js not supported.

node -v
v18.12.1

Using nextjs on a clean project and I'm using typescript with "@types/react-gauge-chart".

@Anyungu
Copy link

Anyungu commented Feb 12, 2023

@kolarski how did you solve this?

I have the same issue and I am not sure installing lodash directly is the best option.

@volkan-a
Copy link

volkan-a commented Feb 19, 2023

Please add loads.isequal module in react-gauge-charts directory.

cd node-modules/react-gauge-charts
npm i lodash.isequal

@script8888
Copy link

script8888 commented Feb 23, 2023

@volkan-a
How would this fix it when deploying to a live server like Netlify or Vercel?

@riccardolardi
Copy link

Same issue. Any update on this?

@riccardolardi
Copy link

Created a PR to fix this #132

@riccardolardi
Copy link

riccardolardi commented May 25, 2023

Published the fork here since I need it for a personal project: https://www.npmjs.com/package/@studioriccardolardi/react-gauge-chart-pr132

I will remove it again as soon as PR is accepted or another solution has been found

You'll need ti create a declaration file to use the existing types from the original package:

declare module '@studioriccardolardi/react-gauge-chart-pr132' {
  import m from 'react-gauge-chart'
  export default m
}

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 a pull request may close this issue.

5 participants