Closed paulbarr closed 8 months 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.
@paulbarr hi, have you solved the issue?
@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
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 👍
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