You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe/explain the bug
TypeError: Axes is not a function. When attempting to run tests on component that contains @nivo/bar. The test runner being used is vitest. I was looking for a workaround to the issue mentioned in #2374 (D3 ES Module import error). I am using Vite and vitest and have set the project to use the ES module (@nivo/[module]/dist/nivo-[module].es.js) version to avoid the ES module import error described in #2374.
The chart works correctly in the browser, the issue is just running the tests.
I am currently on version 0.86.0. This also happens on version 0.85.1.
I added the below into the vite.config.ts file to use the ES module rather than the CJS module:
I am also using pie, line, sunburst and sankey in my main project. The tests for these components are now passing, the issue seems to be within the bar ES module.
I had a look at the codesandbox, but I really don't know what the issue could be, I'm also not familiar with vite.
I tried to import Axes in the test BarChart and the import is defined and can be used as a component 🤔
I had a look at the codesandbox, but I really don't know what the issue could be, I'm also not familiar with vite. I tried to import Axes in the test BarChart and the import is defined and can be used as a component 🤔
Thanks for taking the time to reply.
I will do some further investigation into this issue and report back here if I manage to solve it.
Describe/explain the bug
TypeError: Axes is not a function. When attempting to run tests on component that contains @nivo/bar. The test runner being used is vitest. I was looking for a workaround to the issue mentioned in #2374 (D3 ES Module import error). I am using Vite and vitest and have set the project to use the ES module (@nivo/[module]/dist/nivo-[module].es.js) version to avoid the ES module import error described in #2374.
The chart works correctly in the browser, the issue is just running the tests.
I am currently on version 0.86.0. This also happens on version 0.85.1.
I added the below into the vite.config.ts file to use the ES module rather than the CJS module:
I am also using pie, line, sunburst and sankey in my main project. The tests for these components are now passing, the issue seems to be within the bar ES module.
To Reproduce
https://codesandbox.io/p/devbox/laughing-golick-cxr4qq
Click on the terminal tab to see the failed test. I have added tests for bar, line and pie. The line and pie tests pass but the bar test fails
Steps to reproduce the behavior:
Expected behavior
The es version of the bar module should correctly import the Axes function.
Screenshots
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: