bkrem / react-d3-tree

:deciduous_tree: React component to create interactive D3 tree graphs
https://bkrem.github.io/react-d3-tree
MIT License
1.06k stars 268 forks source link

As soon as I import Tree is always get 'exports is not define' #445

Closed paulbarr closed 8 months ago

paulbarr commented 1 year ago

Thank you for taking the time to report an issue with react-d3-tree!

Feel free to delete any questions that do not apply.

Are you reporting a bug, or opening a feature request?

Bug

What is the actual behavior/output?

I install react-d3-tree using npm As soon as I add these 2 lines anywhere: import React from 'react'; import Tree from 'react-d3-tree';

Then I always get the following error: Uncaught ReferenceError: exports is not defined

What is the behavior/output you expect?

I expect not to get an error

Can you consistently reproduce the issue/create a reproduction case (e.g. on https://codesandbox.io)?

I get it every time, so I cant start using react-d3-tree

What version of react-d3-tree are you using?

3.5.0

Hamzaalam commented 1 year ago

Facing Error when importing the Tree.

import Tree from "react-d3-tree";

Error: Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

DanielChen93 commented 1 year ago

@paulbarr hi, have you solved the issue?

paulbarr commented 1 year ago

@DanielChen93 I did not resolve the issue, but I am using the tree in a different way now so it's no longer an issue for me

bkrem commented 8 months ago

Closing since this is likely a configuration issue outside of react-d3-tree.

Exports are properly defined here: https://github.com/bkrem/react-d3-tree/blob/master/package.json#L15

If still consistently reproducible with an off the shelf config/setup please open a new issue 👍