nivo icon indicating copy to clipboard operation
nivo copied to clipboard

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

Open basavarajum018 opened this issue 3 years ago • 2 comments

nivo-bar.es.js:477 Uncaught TypeError: Object(...) is not a function at e (nivo-bar.es.js:477:1) at pe (nivo-bar.es.js:615:1)

basavarajum018 avatar Jul 21 '22 15:07 basavarajum018

I'm running into this also after copying and pasting the <MyResponsiveBar> example from the home page, on React 16.14.0

This is on a project that has React but not with Typescript.

The error message went away when I went back to an earlier version, specifically 0.74.0 so far. I'll check if some of the other ones work.

The part that got my attention in trying to fix it was in the nivo-bar.es.js file, it does the following:

import { Axes as e /*plus a bunch of others*/ } from "@nivo/axes";

// This is the code that errors line 477
ve = function e(a) {
  var i;
  return a.some(Array.isArray) ? e((i = []).concat.apply(i, a)) : a;
},

In my non-Typescript project, on using the debugger and stopping it at that point, e refers to the top level Axes import, and the function Axes(a) throws the Object(...) is not a function error. I'm assuming it was trying to do some sort of recursive call here.

For what it's worth I did also test it in another project using React & Typescript and the latest version worked as expected. I'm not fully familiar with how typescript does its magic, and I wasn't able to view the nivo-bar.es.js file in the debugger on the Typescript project.

dev-jesser avatar Aug 10 '22 15:08 dev-jesser

Examples on the website are for the latest version of the lib, I suspect that you're using an earlier version where the properties were a bit different. If you could reproduce it in code sandbox, that would help.

plouc avatar Sep 10 '22 01:09 plouc

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] avatar Dec 16 '22 01:12 stale[bot]

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!

stale[bot] avatar Dec 26 '22 03:12 stale[bot]

Bump still facing this issue don't even know where to start fixing it

lylest avatar Sep 27 '23 10:09 lylest