question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: r.node.getBBox is not a function

See original GitHub issue

Hey @junedchhipa, I hope you’re doing well. Since our team implemented the apex-chart all our unit tests (for components that uses apex) get failed.

Uncaught (in promise): TypeError: r.node.getBBox is not a function
    TypeError: r.node.getBBox is not a function

      at new create (../../node_modules/apexcharts/dist/apexcharts.common.js:6:363832)
      at create.bbox (../../node_modules/apexcharts/dist/apexcharts.common.js:6:364039)
      at t.value (../../node_modules/apexcharts/dist/apexcharts.common.js:6:25530)
      at ../../node_modules/apexcharts/dist/apexcharts.common.js:6:168277
          at Array.map (<anonymous>)
      at t.value (../../node_modules/apexcharts/dist/apexcharts.common.js:6:167680)
      at t.value (../../node_modules/apexcharts/dist/apexcharts.common.js:6:172523)
      at t.value (../../node_modules/apexcharts/dist/apexcharts.common.js:6:171960)
      at t.value (../../node_modules/apexcharts/dist/apexcharts.common.js:14:38662)
      at t.create (../../node_modules/apexcharts/dist/apexcharts.common.js:6:3406)
      at ../../node_modules/apexcharts/dist/apexcharts.common.js:14:37322
      at new ZoneAwarePromise (../../node_modules/zone.js/dist/zone.js:931:29)
      at t.value (../../node_modules/apexcharts/dist/apexcharts.common.js:14:36815)
      at ChartComponent.Object.<anonymous>.ChartComponent.render (../../node_modules/ng-apexcharts/bundles/ng:/ng-apexcharts/lib/chart/chart.component.ts:172:26)
      at ChartComponent.Object.<anonymous>.ChartComponent.createElement (../../node_modules/ng-apexcharts/bundles/ng:/ng-apexcharts/lib/chart/chart.component.ts:168:10)
      at AsapAction.work (../../node_modules/ng-apexcharts/bundles/ng:/ng-apexcharts/lib/chart/chart.component.ts:85:12)
      at AsapAction.Object.<anonymous>.AsyncAction._execute (../../node_modules/rxjs/src/internal/scheduler/AsyncAction.ts:122:12)
      at AsapAction.Object.<anonymous>.AsyncAction.execute (../../node_modules/rxjs/src/internal/scheduler/AsyncAction.ts:97:24)
      at AsapScheduler.Object.<anonymous>.AsapScheduler.flush (../../node_modules/rxjs/src/internal/scheduler/AsapScheduler.ts:17:26)
      at runIfPresent (../../node_modules/rxjs/src/internal/util/Immediate.ts:8:5)
      at ../../node_modules/rxjs/src/internal/util/Immediate.ts:16:34
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../node_modules/zone.js/dist/zone.js:391:26)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (../../node_modules/zone.js/dist/proxy.js:129:39)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../node_modules/zone.js/dist/zone.js:390:52)
      at Object.onInvoke (../../../packages/core/src/zone/ng_zone.ts:273:25)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../node_modules/zone.js/dist/zone.js:390:52)
      at Zone.Object.<anonymous>.Zone.run (../../node_modules/zone.js/dist/zone.js:150:43)
      at ../../node_modules/zone.js/dist/zone.js:910:34
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invokeTask (../../node_modules/zone.js/dist/zone.js:423:31)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvokeTask (../../node_modules/zone.js/dist/proxy.js:160:39)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invokeTask (../../node_modules/zone.js/dist/zone.js:422:60)
      at Object.onInvokeTask (../../../packages/core/src/zone/ng_zone.ts:262:25)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invokeTask (../../node_modules/zone.js/dist/zone.js:422:60)
      at Zone.Object.<anonymous>.Zone.runTask (../../node_modules/zone.js/dist/zone.js:195:47)
      at drainMicroTaskQueue (../../node_modules/zone.js/dist/zone.js:601:35)
      at resolvePromise (../../node_modules/zone.js/dist/zone.js:852:31)
      at new ZoneAwarePromise (../../node_modules/zone.js/dist/zone.js:934:17)
      at t.value (../../node_modules/apexcharts/dist/apexcharts.common.js:14:36815)
      at ChartComponent.Object.<anonymous>.ChartComponent.render (../../node_modules/ng-apexcharts/bundles/ng:/ng-apexcharts/lib/chart/chart.component.ts:172:26)
      at ChartComponent.Object.<anonymous>.ChartComponent.createElement (../../node_modules/ng-apexcharts/bundles/ng:/ng-apexcharts/lib/chart/chart.component.ts:168:10)
      at AsapAction.work (../../node_modules/ng-apexcharts/bundles/ng:/ng-apexcharts/lib/chart/chart.component.ts:85:12)
      at AsapAction.Object.<anonymous>.AsyncAction._execute (../../node_modules/rxjs/src/internal/scheduler/AsyncAction.ts:122:12)
      at AsapAction.Object.<anonymous>.AsyncAction.execute (../../node_modules/rxjs/src/internal/scheduler/AsyncAction.ts:97:24)
      at AsapScheduler.Object.<anonymous>.AsapScheduler.flush (../../node_modules/rxjs/src/internal/scheduler/AsapScheduler.ts:17:26)
      at runIfPresent (../../node_modules/rxjs/src/internal/util/Immediate.ts:8:5)
      at ../../node_modules/rxjs/src/internal/util/Immediate.ts:16:34
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../node_modules/zone.js/dist/zone.js:391:26)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (../../node_modules/zone.js/dist/proxy.js:129:39)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../node_modules/zone.js/dist/zone.js:390:52)
      at Object.onInvoke (../../../packages/core/src/zone/ng_zone.ts:273:25)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../node_modules/zone.js/dist/zone.js:390:52)
      at Zone.Object.<anonymous>.Zone.run (../../node_modules/zone.js/dist/zone.js:150:43)
      at ../../node_modules/zone.js/dist/zone.js:910:34
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invokeTask (../../node_modules/zone.js/dist/zone.js:423:31)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvokeTask (../../node_modules/zone.js/dist/proxy.js:160:39)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invokeTask (../../node_modules/zone.js/dist/zone.js:422:60)
      at Object.onInvokeTask (../../../packages/core/src/zone/ng_zone.ts:262:25)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invokeTask (../../node_modules/zone.js/dist/zone.js:422:60)
      at Zone.Object.<anonymous>.Zone.runTask (../../node_modules/zone.js/dist/zone.js:195:47)
      at drainMicroTaskQueue (../../node_modules/zone.js/dist/zone.js:601:35)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11

github_iconTop GitHub Comments

9reactions
ijayoacommented, Aug 10, 2020

@guhcostan-equals I used this to mock apexcharts. maybe it might be helpful

import ApexCharts from "apexcharts";
import ReactApexChart from "react-apexcharts";`

jest.mock("react-apexcharts", () =>
  jest.fn(() => {
    return null;
  })
);
jest.mock("apexcharts", () => ({
  exec: jest.fn(() => {
    return new Promise((resolve, reject) => {
      resolve("uri");
    });
  })
}));
0reactions
rodpatulskicommented, Sep 19, 2022

Hey there, @junedchhipa. facing the same issue here + one more. testing with React testing library and Jest

TypeError: this.node.getScreenCTM is not a function
TypeError: r.node.getBBox is not a function

I also get getScreenCTM in jest

Read more comments on GitHub >

github_iconTop Results From Across the Web

r.node.getBBox is not a function , while running test cases #197
I am using Jest and Enzyme for testing. While mounting the component: TypeError: r.node.getBBox is not a function 33 | it('should invo...
Read more >
TypeError: r.node.getBBox is not a function".] { code ...
I am using jest and testing-library/react to write unit testing. Before this, I have never written any unit testing. After writing the test...
Read more >
getBBox is not a function - GSAP - GreenSock
TypeError : k[0].getBBox is not a function. I am loading TweenMax and the MorphSVGPlugin, is there another dependancy I am missing?
Read more >
Where's getBBox? / Iain Dillingham - Observable
Where's getBBox -- a method of SVGGraphicsElement -- when accessed from within a selection ... TypeError: Cannot read properties of null (reading 'getBBox')....
Read more >
[Solved]-Convert URL Input to Image-Reactjs
TypeError: Cannot read property 'push' of undefined in react.js · Change input given value to a custom value in ReactJS · TypeError: r.node.getBBox...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found