plouc / nivo

nivo provides a rich set of dataviz components, built on top of the awesome d3 and React libraries
https://nivo.rocks
MIT License
13.11k stars 1.03k forks source link

Uncaught TypeError: Object(...) is not a function at e (nivo-bar.es.js:464:1) #2230

Closed abelmo closed 1 year ago

abelmo commented 1 year ago

Describe/explain the bug Adding any sort of bar chart (Bar, ResponsiveBar, CanvasBar) causes the below error. Version used is 0.80.0. Other charts work as expected (e.g Pie, Bullet)

Uncaught TypeError: Object(...) is not a function at e (nivo-bar.es.js:464:1) at pe (nivo-bar.es.js:600:1) at ye (nivo-bar.es.js:733:1) at Ve (nivo-bar.es.js:1236:1) at renderWithHooks (react-dom.development.js:12980:1) at mountIndeterminateComponent (react-dom.development.js:15463:1) at beginWork (react-dom.development.js:16517:1) at HTMLUnknownElement.callCallback (react-dom.development.js:3555:1) ........ The above error occurred in the component:

at Ve (http://localhost:3000/static/js/0.chunk.js:196228:15)
at div
at Jt (http://localhost:3000/static/js/0.chunk.js:198557:15)

My package.json if it's any use:

"dependencies": { "@date-io/moment": "1.x", "@material-ui/core": "^4.9.5", "@material-ui/icons": "^4.2.1", "@material-ui/lab": "^4.0.0-alpha.56", "@material-ui/pickers": "^3.2.10", "@material-ui/styles": "^4.2.1", "@nivo/bar": "^0.80.0", "@nivo/bullet": "^0.80.0", "@nivo/core": "^0.80.0", "@nivo/generators": "^0.80.0", "@nivo/pie": "^0.80.0", "axios": "^0.19.2", "clsx": "^1.0.4", "eslint": "^5.8.0", "history": "^4.9.0", "immutable": "3.8.2", "material-table": "^1.57.2", "moment": "2.29.4", "prop-types": "^15.7.2", "react": "17.0.2", "react-data-grid": "5.0.1", "react-dom": "17.0.2", "react-router-dom": "^5.0.1", "react-scripts": "3.0.1", "riek": "^1.1.0", "styled-components": "^4.3.2" }, "devDependencies": { "@rescripts/cli": "^0.0.11", "@rescripts/rescript-use-babel-config": "^0.0.8", "@rescripts/rescript-use-eslint-config": "^0.0.9", "babel-eslint": "10.0.1" },

To Reproduce I'm unable to reproduce on codesandbox. I noticed the CanvasBar works if I downgrade to nivor/bar@0.63.0 but Bar/ResponsiveBar still throw same error.

Expected behavior Bar charts to render without the above error.

Desktop (please complete the following information):

Additional context I cannot find anything online and i've spent hours trying different versions and combinations with no luck.

abelmo commented 1 year ago

Just to add this person seems to have a similar issue albeit different line at e (nivo-bar.es.js:477:1) https://stackoverflow.com/questions/75051566/bar-chart-not-rendering-in-react-using-the-nivo-library

henrybeggin commented 1 year ago

Im also having this issue, example code in the docs triggers the result. Any help would be massively appreciated

Dependencies:

  "dependencies": {
    "@nivo/bar": "^0.80.0",
    "@nivo/core": "^0.80.0",
    "@nivo/pie": "^0.80.0",
    "@reduxjs/toolkit": "^1.8.6",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "bootstrap": "^5.2.2",
    "match-sorter": "^6.3.1",
    "react": "^18.2.0",
    "react-bootstrap": "^2.5.0",
    "react-csv": "^2.2.2",
    "react-dom": "^18.2.0",
    "react-modal": "^3.15.1",
    "react-pdf": "^5.7.2",
    "react-redux": "^8.0.4",
    "react-router-dom": "^6.4.2",
    "react-scripts": "^2.1.3",
    "react-table": "^7.8.0",
    "redux-thunk": "^2.4.2",
    "tabler-icons-react": "^1.56.0",
    "web-vitals": "^2.1.4"
  }
stale[bot] commented 1 year ago

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] commented 1 year ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!